mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
0b48d1fa36 | ||
|
fec3e2b9f6 |
@@ -2297,7 +2297,7 @@ void Perform(const Handle(Adaptor3d_CurveOnSurface)& theCurveOnSurface,
|
||||
@section upgrade_occt770 Upgrade to OCCT 7.7.0
|
||||
|
||||
@subsection upgrade_occt770_parallel_flag_removed Removed parameter theIsParallel from Put/Compute/Perform
|
||||
|
||||
|
||||
theIsParallel parameter has been removed from Put/Compute/Perform from the next classes:
|
||||
- BRepCheck_Analyzer
|
||||
- BRepCheck_Edge
|
||||
@@ -2311,4 +2311,17 @@ For example:
|
||||
BRepLib_ValidateEdge aValidateEdge(myHCurve, ACS, SameParameter);
|
||||
aValidateEdge.SetParallel(toRunParallel);
|
||||
aValidateEdge.Process();
|
||||
~~~~
|
||||
~~~~
|
||||
|
||||
@subsection upgrade_occt770_drawer_aspects Prs3d_Drawer aspects
|
||||
|
||||
`Prs3d_Drawer` getters no more implicitly create "default" aspects.
|
||||
If specific property has not been set before to this drawer instance nor to linked drawer instance, then NULL property will be returned.
|
||||
Make sure to set property beforehand or to call `SetOwn*` / `SetupOwn*` methods to derive from defaults.
|
||||
|
||||
@subsection upgrade_occt770_view_immupdate V3d_View implicit updates
|
||||
|
||||
`V3d_View::SetImmediateUpdate()` flag has been deprecated and is now disabled by default.
|
||||
So that methods like `V3d_View::Rotation()` or `V3d_View::Panning()` will no more automatically redraw View contents.
|
||||
Application relying on previous behavior still may use `V3d_View::SetImmediateUpdate()` to turn back implicit updates,
|
||||
but encouraged to update their code and put explicit `V3d_View::Redraw()` where necessary, as this functionality will be removed in future.
|
||||
|
@@ -175,7 +175,6 @@ void GlfwOcctView::initViewer()
|
||||
aViewer->SetDefaultTypeOfView (V3d_PERSPECTIVE);
|
||||
aViewer->ActivateGrid (Aspect_GT_Rectangular, Aspect_GDM_Lines);
|
||||
myView = aViewer->CreateView();
|
||||
myView->SetImmediateUpdate (false);
|
||||
myView->SetWindow (myOcctWindow, myOcctWindow->NativeGlContext());
|
||||
myView->ChangeRenderingParams().ToShowStats = true;
|
||||
myContext = new AIS_InteractiveContext (aViewer);
|
||||
|
@@ -259,7 +259,6 @@ bool OcctJni_Viewer::init()
|
||||
Handle(Aspect_NeutralWindow) aWindow = new Aspect_NeutralWindow();
|
||||
aWindow->SetSize (aWidth, aHeight);
|
||||
myView = myViewer->CreateView();
|
||||
myView->SetImmediateUpdate (false);
|
||||
myView->ChangeRenderingParams().Resolution = (unsigned int )(96.0 * myDevicePixelRatio + 0.5);
|
||||
myView->ChangeRenderingParams().ToShowStats = true;
|
||||
myView->ChangeRenderingParams().CollectedStats = (Graphic3d_RenderingParams::PerfCounters ) (Graphic3d_RenderingParams::PerfCounters_FrameRate | Graphic3d_RenderingParams::PerfCounters_Triangles);
|
||||
|
@@ -171,7 +171,6 @@ void CAnimationView3D::OnInitialUpdate()
|
||||
aViewer->SetDefaultTypeOfView (V3d_PERSPECTIVE);
|
||||
|
||||
myView = aViewer->CreateView();
|
||||
myView->SetImmediateUpdate (false);
|
||||
|
||||
// store for restore state after rotation (witch is in Degenerated mode)
|
||||
myHlrModeIsOn = myView->ComputedMode();
|
||||
|
@@ -87,7 +87,6 @@ void OCC_BaseView::OnInitialUpdate()
|
||||
}
|
||||
|
||||
myView = GetAISContext()->CurrentViewer()->CreateView();
|
||||
myView->SetImmediateUpdate (false);
|
||||
myView->SetComputedMode (Standard_False);
|
||||
|
||||
Handle(OpenGl_GraphicDriver) aDriver = Handle(OpenGl_GraphicDriver)::DownCast (myView->Viewer()->Driver());
|
||||
|
@@ -348,7 +348,6 @@ bool AndroidQt::initViewer (Aspect_Drawable theWin)
|
||||
#endif
|
||||
|
||||
myView = myViewer->CreateView();
|
||||
myView->SetImmediateUpdate (Standard_False);
|
||||
|
||||
#ifdef __ANDROID__
|
||||
myView->SetWindow (aWindow, (Aspect_RenderingContext )anEglContext);
|
||||
|
@@ -342,7 +342,6 @@ bool WasmOcctView::initViewer()
|
||||
|
||||
myView = new V3d_View (aViewer);
|
||||
myView->Camera()->SetProjectionType (Graphic3d_Camera::Projection_Perspective);
|
||||
myView->SetImmediateUpdate (false);
|
||||
myView->ChangeRenderingParams().IsShadowEnabled = false;
|
||||
myView->ChangeRenderingParams().Resolution = (unsigned int )(96.0 * myDevicePixelRatio + 0.5);
|
||||
myView->ChangeRenderingParams().ToShowStats = true;
|
||||
|
@@ -50,8 +50,14 @@ void AIS_AnimationCamera::update (const AIS_AnimationProgress& theProgress)
|
||||
Graphic3d_CameraLerp aCamLerp (myCamStart, myCamEnd);
|
||||
aCamLerp.Interpolate (HasOwnDuration() ? theProgress.LocalNormalized : 1.0, aCamera);
|
||||
|
||||
Standard_DISABLE_DEPRECATION_WARNINGS
|
||||
const Standard_Boolean aPrevImmUpdate = myView->SetImmediateUpdate (Standard_False);
|
||||
Standard_ENABLE_DEPRECATION_WARNINGS
|
||||
|
||||
myView->SetCamera (aCamera);
|
||||
myView->SetImmediateUpdate (aPrevImmUpdate);
|
||||
myView->Invalidate();
|
||||
|
||||
Standard_DISABLE_DEPRECATION_WARNINGS
|
||||
myView->SetImmediateUpdate (aPrevImmUpdate);
|
||||
Standard_ENABLE_DEPRECATION_WARNINGS
|
||||
}
|
||||
|
@@ -128,6 +128,7 @@ myIsAutoActivateSelMode(Standard_True)
|
||||
myStyles[Prs3d_TypeOfHighlight_LocalDynamic] = new Prs3d_Drawer();
|
||||
myStyles[Prs3d_TypeOfHighlight_SubIntensity] = new Prs3d_Drawer();
|
||||
|
||||
myDefaultDrawer->SetupOwnDefaults();
|
||||
myDefaultDrawer->SetZLayer(Graphic3d_ZLayerId_Default);
|
||||
myDefaultDrawer->SetDisplayMode(0);
|
||||
{
|
||||
@@ -704,11 +705,15 @@ void AIS_InteractiveContext::HilightWithColor(const Handle(AIS_InteractiveObject
|
||||
const Standard_Boolean theIsToUpdate)
|
||||
{
|
||||
if (theObj.IsNull())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
setContextToObject (theObj);
|
||||
if (!myObjects.IsBound (theObj))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const Handle(AIS_GlobalStatus)& aStatus = myObjects (theObj);
|
||||
aStatus->SetHilightStatus (Standard_True);
|
||||
@@ -720,7 +725,9 @@ void AIS_InteractiveContext::HilightWithColor(const Handle(AIS_InteractiveObject
|
||||
}
|
||||
|
||||
if (theIsToUpdate)
|
||||
{
|
||||
myMainVwr->Update();
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -2300,6 +2307,33 @@ gp_Pnt AIS_InteractiveContext::GravityPoint (const Handle(V3d_View)& theView) co
|
||||
return theView->GravityPoint();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : setContextToObject
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveContext::setContextToObject (const Handle(AIS_InteractiveObject)& theObj)
|
||||
{
|
||||
if (theObj->HasInteractiveContext())
|
||||
{
|
||||
if (theObj->myCTXPtr != this)
|
||||
{
|
||||
throw Standard_ProgramError("AIS_InteractiveContext - object has been already displayed in another context!");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
theObj->SetContext (this);
|
||||
}
|
||||
|
||||
for (PrsMgr_ListOfPresentableObjectsIter aPrsIter (theObj->Children()); aPrsIter.More(); aPrsIter.Next())
|
||||
{
|
||||
if (Handle(AIS_InteractiveObject) aChild = Handle(AIS_InteractiveObject)::DownCast (aPrsIter.Value()))
|
||||
{
|
||||
setContextToObject (aChild);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : setObjectStatus
|
||||
//purpose :
|
||||
|
@@ -1395,20 +1395,7 @@ protected: //! @name internal methods
|
||||
}
|
||||
|
||||
//! Assign the context to the object or throw exception if object was already assigned to another context.
|
||||
void setContextToObject (const Handle(AIS_InteractiveObject)& theObj)
|
||||
{
|
||||
if (theObj->HasInteractiveContext())
|
||||
{
|
||||
if (theObj->myCTXPtr != this)
|
||||
{
|
||||
throw Standard_ProgramError("AIS_InteractiveContext - object has been already displayed in another context!");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
theObj->SetContext (this);
|
||||
}
|
||||
}
|
||||
Standard_EXPORT void setContextToObject (const Handle(AIS_InteractiveObject)& theObj);
|
||||
|
||||
//! Return display mode for highlighting.
|
||||
Standard_Integer getHilightMode (const Handle(AIS_InteractiveObject)& theObj,
|
||||
|
@@ -355,16 +355,28 @@ void AIS_Shape::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
|
||||
StdSelect::SetDrawerForBRepOwner(aSelection,myDrawer);
|
||||
}
|
||||
|
||||
void AIS_Shape::Color( Quantity_Color& aColor ) const {
|
||||
aColor = myDrawer->ShadingAspect()->Color(myCurrentFacingModel);
|
||||
void AIS_Shape::Color (Quantity_Color& theColor) const
|
||||
{
|
||||
if (const Handle(Prs3d_ShadingAspect)& aShading = myDrawer->ShadingAspect())
|
||||
{
|
||||
theColor = myDrawer->ShadingAspect()->Color(myCurrentFacingModel);
|
||||
}
|
||||
}
|
||||
|
||||
Graphic3d_NameOfMaterial AIS_Shape::Material() const {
|
||||
return (myDrawer->ShadingAspect()->Material(myCurrentFacingModel)).Name();
|
||||
Graphic3d_NameOfMaterial AIS_Shape::Material() const
|
||||
{
|
||||
const Handle(Prs3d_ShadingAspect)& aShading = myDrawer->ShadingAspect();
|
||||
return !aShading.IsNull()
|
||||
? aShading->Material(myCurrentFacingModel).Name()
|
||||
: Graphic3d_NameOfMaterial_DEFAULT;
|
||||
}
|
||||
|
||||
Standard_Real AIS_Shape::Transparency() const {
|
||||
return myDrawer->ShadingAspect()->Transparency(myCurrentFacingModel);
|
||||
Standard_Real AIS_Shape::Transparency() const
|
||||
{
|
||||
const Handle(Prs3d_ShadingAspect)& aShading = myDrawer->ShadingAspect();
|
||||
return !aShading.IsNull()
|
||||
? aShading->Transparency(myCurrentFacingModel)
|
||||
: 0.0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -639,9 +651,10 @@ void AIS_Shape::setMaterial (const Handle(Prs3d_Drawer)& theDrawer,
|
||||
const Standard_Boolean theToKeepColor,
|
||||
const Standard_Boolean theToKeepTransp) const
|
||||
{
|
||||
theDrawer->SetupOwnShadingAspect();
|
||||
|
||||
const Quantity_Color aColor = theDrawer->ShadingAspect()->Color (myCurrentFacingModel);
|
||||
const Standard_Real aTransp = theDrawer->ShadingAspect()->Transparency (myCurrentFacingModel);
|
||||
theDrawer->SetupOwnShadingAspect();
|
||||
theDrawer->ShadingAspect()->SetMaterial (theMaterial, myCurrentFacingModel);
|
||||
|
||||
if (theToKeepColor)
|
||||
|
@@ -3239,7 +3239,9 @@ void AIS_ViewController::handleXRPresentations (const Handle(AIS_InteractiveCont
|
||||
void AIS_ViewController::HandleViewEvents (const Handle(AIS_InteractiveContext)& theCtx,
|
||||
const Handle(V3d_View)& theView)
|
||||
{
|
||||
Standard_DISABLE_DEPRECATION_WARNINGS
|
||||
const bool wasImmediateUpdate = theView->SetImmediateUpdate (false);
|
||||
Standard_ENABLE_DEPRECATION_WARNINGS
|
||||
|
||||
handleViewOrientationKeys (theCtx, theView);
|
||||
const AIS_WalkDelta aWalk = handleNavigationKeys (theCtx, theView);
|
||||
@@ -3256,7 +3258,9 @@ void AIS_ViewController::HandleViewEvents (const Handle(AIS_InteractiveContext)&
|
||||
handleViewRedraw (theCtx, theView);
|
||||
theView->View()->UnsetXRPosedCamera();
|
||||
|
||||
Standard_DISABLE_DEPRECATION_WARNINGS
|
||||
theView->SetImmediateUpdate (wasImmediateUpdate);
|
||||
Standard_ENABLE_DEPRECATION_WARNINGS
|
||||
|
||||
// make sure to not process the same events twice
|
||||
myGL.Reset();
|
||||
|
@@ -892,11 +892,17 @@ void AIS_ViewCube::StartAnimation (const Handle(AIS_ViewCubeOwner)& theOwner)
|
||||
{
|
||||
{
|
||||
Handle(Graphic3d_Camera) aBackupCamera = aView->Camera();
|
||||
Standard_DISABLE_DEPRECATION_WARNINGS
|
||||
const bool wasImmediateUpdate = aView->SetImmediateUpdate (false);
|
||||
Standard_ENABLE_DEPRECATION_WARNINGS
|
||||
|
||||
aView->SetCamera (myEndState);
|
||||
aView->SetProj (theOwner->MainOrientation(), myIsYup);
|
||||
aView->SetCamera (aBackupCamera);
|
||||
|
||||
Standard_DISABLE_DEPRECATION_WARNINGS
|
||||
aView->SetImmediateUpdate (wasImmediateUpdate);
|
||||
Standard_ENABLE_DEPRECATION_WARNINGS
|
||||
}
|
||||
|
||||
const gp_Dir aNewDir = myEndState->Direction();
|
||||
|
@@ -171,6 +171,7 @@ static Handle(PipelinePtr) PipelineByActorName (const TCollection_AsciiString& t
|
||||
static Handle(Prs3d_Drawer) createDefaultDrawer()
|
||||
{
|
||||
Handle(Prs3d_Drawer) aGlobalDrawer = new Prs3d_Drawer();
|
||||
aGlobalDrawer->SetupOwnDefaults();
|
||||
aGlobalDrawer->SetTypeOfDeflection (Aspect_TOD_RELATIVE);
|
||||
aGlobalDrawer->SetDeviationCoefficient (0.0001);
|
||||
return aGlobalDrawer;
|
||||
|
@@ -36,6 +36,7 @@ IVtkOCC_Shape::IVtkOCC_Shape (const TopoDS_Shape& theShape,
|
||||
{
|
||||
// these old defaults have been moved from IVtkOCC_ShapeMesher constructor
|
||||
myOCCTDrawer->SetDeviationCoefficient (0.0001); // Aspect_TOD_RELATIVE
|
||||
myOCCTDrawer->SetupOwnDefaults();
|
||||
}
|
||||
buildSubShapeIdMap();
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -55,6 +55,9 @@ public:
|
||||
//! Default constructor.
|
||||
Standard_EXPORT Prs3d_Drawer();
|
||||
|
||||
//! Setup all own aspects with default values.
|
||||
Standard_EXPORT void SetupOwnDefaults();
|
||||
|
||||
//! Sets the type of chordal deflection.
|
||||
//! This indicates whether the deflection value is absolute or relative to the size of the object.
|
||||
Standard_EXPORT void SetTypeOfDeflection (const Aspect_TypeOfDeflection theTypeOfDeflection);
|
||||
@@ -83,58 +86,66 @@ public:
|
||||
//! Prs3d_DeflectionCurve
|
||||
//! Prs3d_WFDeflectionSurface
|
||||
//! Prs3d_WFDeflectionRestrictedFace
|
||||
Standard_EXPORT void SetMaximalChordialDeviation (const Standard_Real theChordialDeviation);
|
||||
void SetMaximalChordialDeviation (const Standard_Real theChordialDeviation)
|
||||
{
|
||||
myChordialDeviation = theChordialDeviation;
|
||||
}
|
||||
|
||||
//! Returns the maximal chordal deviation. The default value is 0.1.
|
||||
//! Returns the maximal chordal deviation. The default value is 0.0001.
|
||||
//! Drawings of curves or patches are made with respect to an absolute maximal chordal deviation.
|
||||
Standard_Real MaximalChordialDeviation() const
|
||||
{
|
||||
return myHasOwnChordialDeviation || myLink.IsNull()
|
||||
return myChordialDeviation > 0.0
|
||||
? myChordialDeviation
|
||||
: myLink->MaximalChordialDeviation();
|
||||
: (!myLink.IsNull()
|
||||
? myLink->MaximalChordialDeviation()
|
||||
: 0.0001);
|
||||
}
|
||||
|
||||
//! Returns true if the drawer has a maximal chordial deviation setting active.
|
||||
Standard_Boolean HasOwnMaximalChordialDeviation() const { return myHasOwnChordialDeviation; }
|
||||
Standard_Boolean HasOwnMaximalChordialDeviation() const { return myChordialDeviation > 0.0; }
|
||||
|
||||
//! Resets HasOwnMaximalChordialDeviation() flag, e.g. undoes SetMaximalChordialDeviation().
|
||||
void UnsetOwnMaximalChordialDeviation()
|
||||
{
|
||||
myHasOwnChordialDeviation = false;
|
||||
myChordialDeviation = 0.0001;
|
||||
myChordialDeviation = -1.0;
|
||||
}
|
||||
|
||||
//! Sets the type of HLR algorithm used by drawer's interactive objects
|
||||
Standard_EXPORT void SetTypeOfHLR (const Prs3d_TypeOfHLR theTypeOfHLR);
|
||||
|
||||
//! Returns the type of HLR algorithm currently in use.
|
||||
Standard_EXPORT Prs3d_TypeOfHLR TypeOfHLR();
|
||||
Standard_EXPORT Prs3d_TypeOfHLR TypeOfHLR() const;
|
||||
|
||||
//! Returns true if the type of HLR is not equal to Prs3d_TOH_NotSet.
|
||||
Standard_Boolean HasOwnTypeOfHLR() const { return (myTypeOfHLR != Prs3d_TOH_NotSet); }
|
||||
|
||||
//! Defines the maximum value allowed for the first and last
|
||||
//! parameters of an infinite curve.
|
||||
Standard_EXPORT void SetMaximalParameterValue (const Standard_Real theValue);
|
||||
void SetMaximalParameterValue (const Standard_Real theValue)
|
||||
{
|
||||
myMaximalParameterValue = theValue;
|
||||
}
|
||||
|
||||
//! Sets the maximum value allowed for the first and last
|
||||
//! parameters of an infinite curve. By default, this value is 500000.
|
||||
//! Sets the maximum value allowed for the first and last parameters of an infinite curve.
|
||||
//! By default, this value is 500000.
|
||||
Standard_Real MaximalParameterValue() const
|
||||
{
|
||||
return myHasOwnMaximalParameterValue || myLink.IsNull()
|
||||
return myMaximalParameterValue > 0.0
|
||||
? myMaximalParameterValue
|
||||
: myLink->MaximalParameterValue();
|
||||
: (!myLink.IsNull()
|
||||
? myLink->MaximalParameterValue()
|
||||
: 500000.0);
|
||||
}
|
||||
|
||||
//! Returns true if the drawer has a maximum value allowed for the first and last
|
||||
//! parameters of an infinite curve setting active.
|
||||
Standard_Boolean HasOwnMaximalParameterValue() const { return myHasOwnMaximalParameterValue; }
|
||||
Standard_Boolean HasOwnMaximalParameterValue() const { return myMaximalParameterValue > 0.0; }
|
||||
|
||||
//! Resets HasOwnMaximalParameterValue() flag, e.g. undoes SetMaximalParameterValue().
|
||||
void UnsetOwnMaximalParameterValue()
|
||||
{
|
||||
myHasOwnMaximalParameterValue = false;
|
||||
myMaximalParameterValue = 500000.0;
|
||||
myMaximalParameterValue = -1.0;
|
||||
}
|
||||
|
||||
//! Sets IsoOnPlane on or off by setting the parameter theIsEnabled to true or false.
|
||||
@@ -180,24 +191,28 @@ public:
|
||||
Standard_EXPORT void SetIsoOnTriangulation (const Standard_Boolean theToEnable);
|
||||
|
||||
//! Sets the discretisation parameter theValue.
|
||||
Standard_EXPORT void SetDiscretisation (const Standard_Integer theValue);
|
||||
void SetDiscretisation (const Standard_Integer theValue)
|
||||
{
|
||||
myNbPoints = theValue;
|
||||
}
|
||||
|
||||
//! Returns the discretisation setting.
|
||||
Standard_Integer Discretisation() const
|
||||
{
|
||||
return myHasOwnNbPoints || myLink.IsNull()
|
||||
return myNbPoints != -1
|
||||
? myNbPoints
|
||||
: myLink->Discretisation();
|
||||
: (!myLink.IsNull()
|
||||
? myLink->Discretisation()
|
||||
: 30);
|
||||
}
|
||||
|
||||
//! Returns true if the drawer has discretisation setting active.
|
||||
Standard_Boolean HasOwnDiscretisation() const { return myHasOwnNbPoints; }
|
||||
Standard_Boolean HasOwnDiscretisation() const { return myNbPoints != -1; }
|
||||
|
||||
//! Resets HasOwnDiscretisation() flag, e.g. undoes SetDiscretisation().
|
||||
void UnsetOwnDiscretisation()
|
||||
{
|
||||
myHasOwnNbPoints = false;
|
||||
myNbPoints = 30;
|
||||
myNbPoints = -1;
|
||||
}
|
||||
|
||||
//! Sets the deviation coefficient theCoefficient.
|
||||
@@ -222,27 +237,28 @@ public:
|
||||
//! SizeOfObject * DeviationCoefficient.
|
||||
Standard_Real DeviationCoefficient() const
|
||||
{
|
||||
return HasOwnDeviationCoefficient() || myLink.IsNull()
|
||||
return myDeviationCoefficient > 0.0
|
||||
? myDeviationCoefficient
|
||||
: myLink->DeviationCoefficient();
|
||||
: (!myLink.IsNull()
|
||||
? myLink->DeviationCoefficient()
|
||||
: 0.001);
|
||||
}
|
||||
|
||||
//! Resets HasOwnDeviationCoefficient() flag, e.g. undoes previous SetDeviationCoefficient().
|
||||
void SetDeviationCoefficient()
|
||||
{
|
||||
myHasOwnDeviationCoefficient = Standard_False;
|
||||
myDeviationCoefficient = 0.001;
|
||||
myDeviationCoefficient = -1.0;
|
||||
}
|
||||
|
||||
//! Returns true if there is a local setting for deviation
|
||||
//! coefficient in this framework for a specific interactive object.
|
||||
Standard_Boolean HasOwnDeviationCoefficient() const { return myHasOwnDeviationCoefficient; }
|
||||
Standard_Boolean HasOwnDeviationCoefficient() const { return myDeviationCoefficient > 0.0; }
|
||||
|
||||
//! Saves the previous value used for the chordal
|
||||
//! deviation coefficient.
|
||||
Standard_Real PreviousDeviationCoefficient() const
|
||||
{
|
||||
return myHasOwnDeviationCoefficient
|
||||
return HasOwnDeviationCoefficient()
|
||||
? myPreviousDeviationCoefficient
|
||||
: 0.0;
|
||||
}
|
||||
@@ -250,7 +266,7 @@ public:
|
||||
//! Updates the previous value used for the chordal deviation coefficient to the current state.
|
||||
void UpdatePreviousDeviationCoefficient()
|
||||
{
|
||||
if (myHasOwnDeviationCoefficient)
|
||||
if (HasOwnDeviationCoefficient())
|
||||
{
|
||||
myPreviousDeviationCoefficient = DeviationCoefficient();
|
||||
}
|
||||
@@ -263,26 +279,27 @@ public:
|
||||
//! Returns the value for deviation angle in radians, 20 * M_PI / 180 by default.
|
||||
Standard_Real DeviationAngle() const
|
||||
{
|
||||
return HasOwnDeviationAngle() || myLink.IsNull()
|
||||
return myDeviationAngle > 0.0
|
||||
? myDeviationAngle
|
||||
: myLink->DeviationAngle();
|
||||
: (!myLink.IsNull()
|
||||
? myLink->DeviationAngle()
|
||||
: 20.0 * M_PI / 180.0);
|
||||
}
|
||||
|
||||
//! Resets HasOwnDeviationAngle() flag, e.g. undoes previous SetDeviationAngle().
|
||||
void SetDeviationAngle()
|
||||
{
|
||||
myHasOwnDeviationAngle = Standard_False;
|
||||
myDeviationAngle = 20.0 * M_PI / 180.0;
|
||||
myDeviationAngle = -1.0;
|
||||
}
|
||||
|
||||
//! Returns true if there is a local setting for deviation
|
||||
//! angle in this framework for a specific interactive object.
|
||||
Standard_Boolean HasOwnDeviationAngle() const { return myHasOwnDeviationAngle; }
|
||||
Standard_Boolean HasOwnDeviationAngle() const { return myDeviationAngle > 0.0; }
|
||||
|
||||
//! Returns the previous deviation angle
|
||||
Standard_Real PreviousDeviationAngle() const
|
||||
{
|
||||
return myHasOwnDeviationAngle
|
||||
return HasOwnDeviationAngle()
|
||||
? myPreviousDeviationAngle
|
||||
: 0.0;
|
||||
}
|
||||
@@ -290,7 +307,7 @@ public:
|
||||
//! Updates the previous deviation angle to the current value
|
||||
void UpdatePreviousDeviationAngle()
|
||||
{
|
||||
if (myHasOwnDeviationAngle)
|
||||
if (HasOwnDeviationAngle())
|
||||
{
|
||||
myPreviousDeviationAngle = DeviationAngle();
|
||||
}
|
||||
@@ -320,64 +337,54 @@ public:
|
||||
myIsAutoTriangulated = true;
|
||||
}
|
||||
|
||||
//! Defines the attributes which are used when drawing an
|
||||
//! U isoparametric curve of a face. Defines the number
|
||||
//! of U isoparametric curves to be drawn for a single face.
|
||||
//! The LineAspect for U isoparametric lines can be edited
|
||||
//! (methods SetColor, SetTypeOfLine, SetWidth, SetNumber)
|
||||
//! The default values are:
|
||||
//! COLOR : Quantity_NOC_GRAY75
|
||||
//! TYPE OF LINE: Aspect_TOL_SOLID
|
||||
//! WIDTH : 0.5
|
||||
//! Defines own attributes for drawing an U isoparametric curve of a face,
|
||||
//! settings from linked Drawer or NULL if neither was set.
|
||||
//!
|
||||
//! These attributes are used by the following algorithms:
|
||||
//! Prs3d_WFDeflectionSurface
|
||||
//! Prs3d_WFDeflectionRestrictedFace
|
||||
Standard_EXPORT const Handle(Prs3d_IsoAspect)& UIsoAspect();
|
||||
Standard_EXPORT const Handle(Prs3d_IsoAspect)& UIsoAspect() const;
|
||||
|
||||
Standard_EXPORT void SetUIsoAspect (const Handle(Prs3d_IsoAspect)& theAspect);
|
||||
void SetUIsoAspect (const Handle(Prs3d_IsoAspect)& theAspect)
|
||||
{
|
||||
myUIsoAspect = theAspect;
|
||||
}
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! UIso aspect that overrides the one in the link.
|
||||
Standard_Boolean HasOwnUIsoAspect() const { return myHasOwnUIsoAspect; }
|
||||
Standard_Boolean HasOwnUIsoAspect() const { return !myUIsoAspect.IsNull(); }
|
||||
|
||||
//! Defines the attributes which are used when drawing an
|
||||
//! V isoparametric curve of a face. Defines the number
|
||||
//! of V isoparametric curves to be drawn for a single face.
|
||||
//! The LineAspect for V isoparametric lines can be edited
|
||||
//! (methods SetColor, SetTypeOfLine, SetWidth, SetNumber)
|
||||
//! The default values are:
|
||||
//! COLOR : Quantity_NOC_GRAY82
|
||||
//! TYPE OF LINE: Aspect_TOL_SOLID
|
||||
//! WIDTH : 0.5
|
||||
//! Defines own attributes for drawing an V isoparametric curve of a face,
|
||||
//! settings from linked Drawer or NULL if neither was set.
|
||||
//!
|
||||
//! These attributes are used by the following algorithms:
|
||||
//! Prs3d_WFDeflectionSurface
|
||||
//! Prs3d_WFDeflectionRestrictedFace
|
||||
Standard_EXPORT const Handle(Prs3d_IsoAspect)& VIsoAspect();
|
||||
Standard_EXPORT const Handle(Prs3d_IsoAspect)& VIsoAspect() const;
|
||||
|
||||
//! Sets the appearance of V isoparameters - theAspect.
|
||||
Standard_EXPORT void SetVIsoAspect (const Handle(Prs3d_IsoAspect)& theAspect);
|
||||
void SetVIsoAspect (const Handle(Prs3d_IsoAspect)& theAspect)
|
||||
{
|
||||
myVIsoAspect = theAspect;
|
||||
}
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! VIso aspect that overrides the one in the link.
|
||||
Standard_Boolean HasOwnVIsoAspect() const { return myHasOwnVIsoAspect; }
|
||||
Standard_Boolean HasOwnVIsoAspect() const { return !myVIsoAspect.IsNull(); }
|
||||
|
||||
//! Returns wire aspect settings.
|
||||
//! The LineAspect for the free boundaries can be edited.
|
||||
//! The default values are:
|
||||
//! Color: Quantity_NOC_GREEN
|
||||
//! Type of line: Aspect_TOL_SOLID
|
||||
//! Width: 1.0
|
||||
//! Returns own wire aspect settings, settings from linked Drawer or NULL if neither was set.
|
||||
//! These attributes are used by the algorithm Prs3d_WFShape.
|
||||
Standard_EXPORT const Handle(Prs3d_LineAspect)& WireAspect();
|
||||
Standard_EXPORT const Handle(Prs3d_LineAspect)& WireAspect() const;
|
||||
|
||||
//! Sets the parameter theAspect for display of wires.
|
||||
Standard_EXPORT void SetWireAspect (const Handle(Prs3d_LineAspect)& theAspect);
|
||||
void SetWireAspect (const Handle(Prs3d_LineAspect)& theAspect)
|
||||
{
|
||||
myWireAspect = theAspect;
|
||||
}
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! wire aspect that overrides the one in the link.
|
||||
Standard_Boolean HasOwnWireAspect() const { return myHasOwnWireAspect; }
|
||||
Standard_Boolean HasOwnWireAspect() const { return !myWireAspect.IsNull(); }
|
||||
|
||||
//! Sets WireDraw on or off by setting the parameter theIsEnabled to true or false.
|
||||
Standard_EXPORT void SetWireDraw(const Standard_Boolean theIsEnabled);
|
||||
@@ -401,43 +408,46 @@ public:
|
||||
myWireDraw = true;
|
||||
}
|
||||
|
||||
//! Returns the point aspect setting. The default values are
|
||||
//! Color: Quantity_NOC_YELLOW
|
||||
//! Type of marker: Aspect_TOM_PLUS
|
||||
//! Scale: 1.0
|
||||
//! Returns own point aspect setting, settings from linked Drawer or NULL if neither was set.
|
||||
//! These attributes are used by the algorithms Prs3d_Point.
|
||||
Standard_EXPORT const Handle(Prs3d_PointAspect)& PointAspect();
|
||||
Standard_EXPORT const Handle(Prs3d_PointAspect)& PointAspect() const;
|
||||
|
||||
//! Sets the parameter theAspect for display attributes of points
|
||||
Standard_EXPORT void SetPointAspect (const Handle(Prs3d_PointAspect)& theAspect);
|
||||
void SetPointAspect (const Handle(Prs3d_PointAspect)& theAspect)
|
||||
{
|
||||
myPointAspect = theAspect;
|
||||
}
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! point aspect that overrides the one in the link.
|
||||
Standard_Boolean HasOwnPointAspect() const { return myHasOwnPointAspect; }
|
||||
Standard_Boolean HasOwnPointAspect() const { return !myPointAspect.IsNull(); }
|
||||
|
||||
//! Sets own point aspect.
|
||||
//! Sets own point aspect, which is a yellow Aspect_TOM_PLUS marker by default.
|
||||
//! Returns FALSE if the drawer already has its own attribute for point aspect.
|
||||
Standard_EXPORT Standard_Boolean SetupOwnPointAspect (const Handle(Prs3d_Drawer)& theDefaults = Handle(Prs3d_Drawer)());
|
||||
|
||||
//! Returns settings for line aspects.
|
||||
//! These settings can be edited. The default values are:
|
||||
//! Color: Quantity_NOC_YELLOW
|
||||
//! Type of line: Aspect_TOL_SOLID
|
||||
//! Width: 1.0
|
||||
//! Returns own settings for line aspects, settings from linked Drawer or NULL if neither was set.
|
||||
//! These attributes are used by the following algorithms:
|
||||
//! Prs3d_Curve
|
||||
//! Prs3d_Line
|
||||
//! Prs3d_HLRShape
|
||||
Standard_EXPORT const Handle(Prs3d_LineAspect)& LineAspect();
|
||||
Standard_EXPORT const Handle(Prs3d_LineAspect)& LineAspect() const;
|
||||
|
||||
//! Sets the parameter theAspect for display attributes of lines.
|
||||
Standard_EXPORT void SetLineAspect (const Handle(Prs3d_LineAspect)& theAspect);
|
||||
void SetLineAspect (const Handle(Prs3d_LineAspect)& theAspect)
|
||||
{
|
||||
myLineAspect = theAspect;
|
||||
}
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! line aspect that overrides the one in the link.
|
||||
Standard_Boolean HasOwnLineAspect() const { return myHasOwnLineAspect; }
|
||||
Standard_Boolean HasOwnLineAspect() const { return !myLineAspect.IsNull(); }
|
||||
|
||||
//! Sets own line aspects.
|
||||
//! Sets own line aspects, which are
|
||||
//! single U and single V gray75 solid isolines (::UIsoAspect(), ::VIsoAspect()),
|
||||
//! red wire (::WireAspect()), yellow line (::LineAspect()),
|
||||
//! yellow seen line (::SeenLineAspect()), dashed yellow hidden line (::HiddenLineAspect()),
|
||||
//! green free boundary (::FreeBoundaryAspect()), yellow unfree boundary (::UnFreeBoundaryAspect()).
|
||||
//! Returns FALSE if own line aspect are already set.
|
||||
Standard_EXPORT Standard_Boolean SetOwnLineAspects (const Handle(Prs3d_Drawer)& theDefaults = Handle(Prs3d_Drawer)());
|
||||
|
||||
@@ -445,73 +455,74 @@ public:
|
||||
//! Returns FALSE if own line for datums are already set.
|
||||
Standard_EXPORT Standard_Boolean SetOwnDatumAspects (const Handle(Prs3d_Drawer)& theDefaults = Handle(Prs3d_Drawer)());
|
||||
|
||||
//! Returns settings for text aspect.
|
||||
//! These settings can be edited. The default value is:
|
||||
//! - Color: Quantity_NOC_YELLOW
|
||||
Standard_EXPORT const Handle(Prs3d_TextAspect)& TextAspect();
|
||||
//! Returns own settings for text aspect, settings from linked Drawer or NULL if neither was set.
|
||||
Standard_EXPORT const Handle(Prs3d_TextAspect)& TextAspect() const;
|
||||
|
||||
//! Sets the parameter theAspect for display attributes of text.
|
||||
Standard_EXPORT void SetTextAspect (const Handle(Prs3d_TextAspect)& theAspect);
|
||||
void SetTextAspect (const Handle(Prs3d_TextAspect)& theAspect)
|
||||
{
|
||||
myTextAspect = theAspect;
|
||||
}
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! text aspect that overrides the one in the link.
|
||||
Standard_Boolean HasOwnTextAspect() const { return myHasOwnTextAspect; }
|
||||
Standard_Boolean HasOwnTextAspect() const { return !myTextAspect.IsNull(); }
|
||||
|
||||
//! Returns settings for shading aspects.
|
||||
//! These settings can be edited. The default values are:
|
||||
//! - Color: Quantity_NOC_YELLOW
|
||||
//! - Material: Graphic3d_NameOfMaterial_Brass
|
||||
//! Shading aspect is obtained through decomposition of
|
||||
//! 3d faces into triangles, each side of each triangle
|
||||
//! being a chord of the corresponding curved edge in the face.
|
||||
//! Reflection of light in each projector perspective is then calculated for each of the
|
||||
//! resultant triangular planes.
|
||||
Standard_EXPORT const Handle(Prs3d_ShadingAspect)& ShadingAspect();
|
||||
//! Returns own settings for shading aspects, settings from linked Drawer or NULL if neither was set.
|
||||
Standard_EXPORT const Handle(Prs3d_ShadingAspect)& ShadingAspect() const;
|
||||
|
||||
//! Sets the parameter theAspect for display attributes of shading.
|
||||
Standard_EXPORT void SetShadingAspect (const Handle(Prs3d_ShadingAspect)& theAspect);
|
||||
void SetShadingAspect (const Handle(Prs3d_ShadingAspect)& theAspect)
|
||||
{
|
||||
myShadingAspect = theAspect;
|
||||
}
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! shading aspect that overrides the one in the link.
|
||||
Standard_Boolean HasOwnShadingAspect() const { return myHasOwnShadingAspect; }
|
||||
Standard_Boolean HasOwnShadingAspect() const { return !myShadingAspect.IsNull(); }
|
||||
|
||||
//! Sets own shading aspect.
|
||||
//! Sets own shading aspect, which is Graphic3d_NameOfMaterial_Brass material by default.
|
||||
//! Returns FALSE if the drawer already has its own attribute for shading aspect.
|
||||
Standard_EXPORT Standard_Boolean SetupOwnShadingAspect (const Handle(Prs3d_Drawer)& theDefaults = Handle(Prs3d_Drawer)());
|
||||
|
||||
//! Returns settings for seen line aspects.
|
||||
//! These settings can be edited. The default values are:
|
||||
//! Color: Quantity_NOC_YELLOW
|
||||
//! Type of line: Aspect_TOL_SOLID
|
||||
//! Width: 1.0
|
||||
Standard_EXPORT const Handle(Prs3d_LineAspect)& SeenLineAspect();
|
||||
//! Returns own settings for seen line aspects, settings of linked Drawer or NULL if neither was set.
|
||||
Standard_EXPORT const Handle(Prs3d_LineAspect)& SeenLineAspect() const;
|
||||
|
||||
//! Sets the parameter theAspect for the display of seen lines in hidden line removal mode.
|
||||
Standard_EXPORT void SetSeenLineAspect (const Handle(Prs3d_LineAspect)& theAspect);
|
||||
void SetSeenLineAspect (const Handle(Prs3d_LineAspect)& theAspect)
|
||||
{
|
||||
mySeenLineAspect = theAspect;
|
||||
}
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! seen line aspect that overrides the one in the link.
|
||||
Standard_Boolean HasOwnSeenLineAspect() const { return myHasOwnSeenLineAspect; }
|
||||
Standard_Boolean HasOwnSeenLineAspect() const { return !mySeenLineAspect.IsNull(); }
|
||||
|
||||
//! Returns settings for the appearance of planes.
|
||||
Standard_EXPORT const Handle(Prs3d_PlaneAspect)& PlaneAspect();
|
||||
//! Returns own settings for the appearance of planes, settings from linked Drawer or NULL if neither was set.
|
||||
Standard_EXPORT const Handle(Prs3d_PlaneAspect)& PlaneAspect() const;
|
||||
|
||||
//! Sets the parameter theAspect for the display of planes.
|
||||
Standard_EXPORT void SetPlaneAspect (const Handle(Prs3d_PlaneAspect)& theAspect);
|
||||
void SetPlaneAspect (const Handle(Prs3d_PlaneAspect)& theAspect)
|
||||
{
|
||||
myPlaneAspect = theAspect;
|
||||
}
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! plane aspect that overrides the one in the link.
|
||||
Standard_Boolean HasOwnPlaneAspect() const { return myHasOwnPlaneAspect; }
|
||||
Standard_Boolean HasOwnPlaneAspect() const { return !myPlaneAspect.IsNull(); }
|
||||
|
||||
//! Returns the attributes for display of arrows.
|
||||
Standard_EXPORT const Handle(Prs3d_ArrowAspect)& ArrowAspect();
|
||||
//! Returns own attributes for display of arrows, settings from linked Drawer or NULL if neither was set.
|
||||
Standard_EXPORT const Handle(Prs3d_ArrowAspect)& ArrowAspect() const;
|
||||
|
||||
//! Sets the parameter theAspect for display attributes of arrows.
|
||||
Standard_EXPORT void SetArrowAspect (const Handle(Prs3d_ArrowAspect)& theAspect);
|
||||
void SetArrowAspect (const Handle(Prs3d_ArrowAspect)& theAspect)
|
||||
{
|
||||
myArrowAspect = theAspect;
|
||||
}
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! arrow aspect that overrides the one in the link.
|
||||
Standard_Boolean HasOwnArrowAspect() const { return myHasOwnArrowAspect; }
|
||||
Standard_Boolean HasOwnArrowAspect() const { return !myArrowAspect.IsNull(); }
|
||||
|
||||
//! Enables the drawing of an arrow at the end of each line.
|
||||
//! By default the arrows are not drawn.
|
||||
@@ -537,19 +548,18 @@ public:
|
||||
myLineArrowDraw = false;
|
||||
}
|
||||
|
||||
//! Returns settings for hidden line aspects.
|
||||
//! These settings can be edited. The default values are:
|
||||
//! Color: Quantity_NOC_YELLOW
|
||||
//! Type of line: Aspect_TOL_DASH
|
||||
//! Width: 1.0
|
||||
Standard_EXPORT const Handle(Prs3d_LineAspect)& HiddenLineAspect();
|
||||
//! Returns own settings for hidden line aspects, settings from linked Drawer or NULL if neither was set.
|
||||
Standard_EXPORT const Handle(Prs3d_LineAspect)& HiddenLineAspect() const;
|
||||
|
||||
//! Sets the parameter theAspect for the display of hidden lines in hidden line removal mode.
|
||||
Standard_EXPORT void SetHiddenLineAspect (const Handle(Prs3d_LineAspect)& theAspect);
|
||||
void SetHiddenLineAspect (const Handle(Prs3d_LineAspect)& theAspect)
|
||||
{
|
||||
myHiddenLineAspect = theAspect;
|
||||
}
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! hidden lines aspect that overrides the one in the link.
|
||||
Standard_Boolean HasOwnHiddenLineAspect() const { return myHasOwnHiddenLineAspect; }
|
||||
Standard_Boolean HasOwnHiddenLineAspect() const { return !myHiddenLineAspect.IsNull(); }
|
||||
|
||||
//! Returns Standard_True if the hidden lines are to be drawn.
|
||||
//! By default the hidden lines are not drawn.
|
||||
@@ -577,19 +587,18 @@ public:
|
||||
myDrawHiddenLine = false;
|
||||
}
|
||||
|
||||
//! Returns settings for the appearance of vectors.
|
||||
//! These settings can be edited. The default values are:
|
||||
//! Color: Quantity_NOC_SKYBLUE
|
||||
//! Type of line: Aspect_TOL_SOLID
|
||||
//! Width: 1.0
|
||||
Standard_EXPORT const Handle(Prs3d_LineAspect)& VectorAspect();
|
||||
//! Returns own settings for the appearance of vectors, settings from linked Drawer or NULL if neither was set.
|
||||
Standard_EXPORT const Handle(Prs3d_LineAspect)& VectorAspect() const;
|
||||
|
||||
//! Sets the modality theAspect for the display of vectors.
|
||||
Standard_EXPORT void SetVectorAspect (const Handle(Prs3d_LineAspect)& theAspect);
|
||||
void SetVectorAspect (const Handle(Prs3d_LineAspect)& theAspect)
|
||||
{
|
||||
myVectorAspect = theAspect;
|
||||
}
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! vector aspect that overrides the one in the link.
|
||||
Standard_Boolean HasOwnVectorAspect() const { return myHasOwnVectorAspect; }
|
||||
Standard_Boolean HasOwnVectorAspect() const { return !myVectorAspect.IsNull(); }
|
||||
|
||||
//! Sets the mode of visualization of vertices of a TopoDS_Shape instance.
|
||||
//! By default, only stand-alone vertices (not belonging topologically to an edge) are drawn,
|
||||
@@ -600,60 +609,56 @@ public:
|
||||
Standard_EXPORT void SetVertexDrawMode (const Prs3d_VertexDrawMode theMode);
|
||||
|
||||
//! Returns the current mode of visualization of vertices of a TopoDS_Shape instance.
|
||||
Standard_EXPORT Prs3d_VertexDrawMode VertexDrawMode();
|
||||
Standard_EXPORT Prs3d_VertexDrawMode VertexDrawMode() const;
|
||||
|
||||
//! Returns true if the vertex draw mode is not equal to <b>Prs3d_VDM_Inherited</b>.
|
||||
//! This means that individual vertex draw mode value (i.e. not inherited from the global
|
||||
//! drawer) is used for a specific interactive object.
|
||||
Standard_Boolean HasOwnVertexDrawMode() const { return (myVertexDrawMode != Prs3d_VDM_Inherited); }
|
||||
|
||||
//! Returns settings for the appearance of datums.
|
||||
//! These settings can be edited. The default values for the three axes are:
|
||||
//! Color: Quantity_NOC_PEACHPUFF
|
||||
//! Type of line: Aspect_TOL_SOLID
|
||||
//! Width: 1.0
|
||||
Standard_EXPORT const Handle(Prs3d_DatumAspect)& DatumAspect();
|
||||
//! Returns own settings for the appearance of datums, settings from linked Drawer or NULL if neither was set.
|
||||
Standard_EXPORT const Handle(Prs3d_DatumAspect)& DatumAspect() const;
|
||||
|
||||
//! Sets the modality theAspect for the display of datums.
|
||||
Standard_EXPORT void SetDatumAspect (const Handle(Prs3d_DatumAspect)& theAspect);
|
||||
void SetDatumAspect (const Handle(Prs3d_DatumAspect)& theAspect)
|
||||
{
|
||||
myDatumAspect = theAspect;
|
||||
}
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! datum aspect that overrides the one in the link.
|
||||
Standard_Boolean HasOwnDatumAspect() const { return myHasOwnDatumAspect; }
|
||||
Standard_Boolean HasOwnDatumAspect() const { return !myDatumAspect.IsNull(); }
|
||||
|
||||
//! The LineAspect for the wire can be edited.
|
||||
//! The default values are:
|
||||
//! Color: Quantity_NOC_ORANGE
|
||||
//! Type of line: Aspect_TOL_SOLID
|
||||
//! Width: 1.0
|
||||
//! Returns own LineAspect for section wire, settings from linked Drawer or NULL if neither was set.
|
||||
//! These attributes are used by the algorithm Prs3d_WFShape.
|
||||
Standard_EXPORT const Handle(Prs3d_LineAspect)& SectionAspect();
|
||||
Standard_EXPORT const Handle(Prs3d_LineAspect)& SectionAspect() const;
|
||||
|
||||
//! Sets the parameter theAspect for display attributes of sections.
|
||||
Standard_EXPORT void SetSectionAspect (const Handle(Prs3d_LineAspect)& theAspect);
|
||||
void SetSectionAspect (const Handle(Prs3d_LineAspect)& theAspect)
|
||||
{
|
||||
mySectionAspect = theAspect;
|
||||
}
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! section aspect that overrides the one in the link.
|
||||
Standard_Boolean HasOwnSectionAspect() const { return myHasOwnSectionAspect; }
|
||||
Standard_Boolean HasOwnSectionAspect() const { return !mySectionAspect.IsNull(); }
|
||||
|
||||
//! Sets the parameter theAspect for the display of free boundaries.
|
||||
//! The method sets aspect owned by the drawer that will be used during
|
||||
//! visualization instead of the one set in link.
|
||||
Standard_EXPORT void SetFreeBoundaryAspect (const Handle(Prs3d_LineAspect)& theAspect);
|
||||
void SetFreeBoundaryAspect (const Handle(Prs3d_LineAspect)& theAspect)
|
||||
{
|
||||
myFreeBoundaryAspect = theAspect;
|
||||
}
|
||||
|
||||
//! Returns the values for presentation of free boundaries,
|
||||
//! in other words, boundaries which are not shared.
|
||||
//! The LineAspect for the free boundaries can be edited.
|
||||
//! The default values are:
|
||||
//! Color: Quantity_NOC_GREEN
|
||||
//! Type of line: Aspect_TOL_SOLID
|
||||
//! Width: 1.0
|
||||
//! Returns own settings for presentation of free boundaries, settings from linked Drawer or NULL if neither was set.
|
||||
//! In other words, this settings affect boundaries which are not shared.
|
||||
//! These attributes are used by the algorithm Prs3d_WFShape
|
||||
Standard_EXPORT const Handle(Prs3d_LineAspect)& FreeBoundaryAspect();
|
||||
Standard_EXPORT const Handle(Prs3d_LineAspect)& FreeBoundaryAspect() const;
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! free boundaries aspect that overrides the one in the link.
|
||||
Standard_Boolean HasOwnFreeBoundaryAspect() const { return myHasOwnFreeBoundaryAspect; }
|
||||
Standard_Boolean HasOwnFreeBoundaryAspect() const { return !myFreeBoundaryAspect.IsNull(); }
|
||||
|
||||
//! Enables or disables drawing of free boundaries for shading presentations.
|
||||
//! The method sets drawing flag owned by the drawer that will be used during
|
||||
@@ -685,20 +690,18 @@ public:
|
||||
//! Sets the parameter theAspect for the display of shared boundaries.
|
||||
//! The method sets aspect owned by the drawer that will be used during
|
||||
//! visualization instead of the one set in link.
|
||||
Standard_EXPORT void SetUnFreeBoundaryAspect (const Handle(Prs3d_LineAspect)& theAspect);
|
||||
void SetUnFreeBoundaryAspect (const Handle(Prs3d_LineAspect)& theAspect)
|
||||
{
|
||||
myUnFreeBoundaryAspect = theAspect;
|
||||
}
|
||||
|
||||
//! Returns settings for shared boundary line aspects.
|
||||
//! The LineAspect for the unfree boundaries can be edited.
|
||||
//! The default values are:
|
||||
//! Color: Quantity_NOC_YELLOW
|
||||
//! Type of line: Aspect_TOL_SOLID
|
||||
//! Width: 1.
|
||||
//! Returns own settings for shared boundary line aspects, settings from linked Drawer or NULL if neither was set.
|
||||
//! These attributes are used by the algorithm Prs3d_WFShape
|
||||
Standard_EXPORT const Handle(Prs3d_LineAspect)& UnFreeBoundaryAspect();
|
||||
Standard_EXPORT const Handle(Prs3d_LineAspect)& UnFreeBoundaryAspect() const;
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! unfree boundaries aspect that overrides the one in the link.
|
||||
Standard_Boolean HasOwnUnFreeBoundaryAspect() const { return myHasOwnUnFreeBoundaryAspect; }
|
||||
Standard_Boolean HasOwnUnFreeBoundaryAspect() const { return !myUnFreeBoundaryAspect.IsNull(); }
|
||||
|
||||
//! Enables or disables drawing of shared boundaries for shading presentations.
|
||||
//! The method sets drawing flag owned by the drawer that will be used during
|
||||
@@ -730,16 +733,19 @@ public:
|
||||
//! The method sets line aspect owned by the drawer that will be used during
|
||||
//! visualization instead of the one set in link.
|
||||
//! theAspect is the line aspect that determines the look of the face boundaries.
|
||||
Standard_EXPORT void SetFaceBoundaryAspect (const Handle(Prs3d_LineAspect)& theAspect);
|
||||
void SetFaceBoundaryAspect (const Handle(Prs3d_LineAspect)& theAspect)
|
||||
{
|
||||
myFaceBoundaryAspect = theAspect;
|
||||
}
|
||||
|
||||
//! Returns line aspect of face boundaries.
|
||||
Standard_EXPORT const Handle(Prs3d_LineAspect)& FaceBoundaryAspect();
|
||||
//! Returns own line aspect of face boundaries, settings from linked Drawer or NULL if neither was set.
|
||||
Standard_EXPORT const Handle(Prs3d_LineAspect)& FaceBoundaryAspect() const;
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! face boundaries aspect that overrides the one in the link.
|
||||
Standard_Boolean HasOwnFaceBoundaryAspect() const { return myHasOwnFaceBoundaryAspect; }
|
||||
Standard_Boolean HasOwnFaceBoundaryAspect() const { return !myFaceBoundaryAspect.IsNull(); }
|
||||
|
||||
//! Sets own face boundary aspect.
|
||||
//! Sets own face boundary aspect, which is a black solid line by default.
|
||||
//! Returns FALSE if the drawer already has its own attribute for face boundary aspect.
|
||||
Standard_EXPORT Standard_Boolean SetupOwnFaceBoundaryAspect (const Handle(Prs3d_Drawer)& theDefaults = Handle(Prs3d_Drawer)());
|
||||
|
||||
@@ -787,17 +793,20 @@ public:
|
||||
//! Unset the most edge continuity class for face boundaries.
|
||||
void UnsetFaceBoundaryUpperContinuity() { myFaceBoundaryUpperContinuity = -1; }
|
||||
|
||||
//! Returns settings for the appearance of dimensions.
|
||||
Standard_EXPORT const Handle(Prs3d_DimensionAspect)& DimensionAspect();
|
||||
//! Returns own settings for the appearance of dimensions, settings from linked Drawer or NULL if neither was set.
|
||||
Standard_EXPORT const Handle(Prs3d_DimensionAspect)& DimensionAspect() const;
|
||||
|
||||
//! Sets the settings for the appearance of dimensions.
|
||||
//! The method sets aspect owned by the drawer that will be used during
|
||||
//! visualization instead of the one set in link.
|
||||
Standard_EXPORT void SetDimensionAspect (const Handle(Prs3d_DimensionAspect)& theAspect);
|
||||
void SetDimensionAspect (const Handle(Prs3d_DimensionAspect)& theAspect)
|
||||
{
|
||||
myDimensionAspect = theAspect;
|
||||
}
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! the appearance of dimensions that overrides the one in the link.
|
||||
Standard_Boolean HasOwnDimensionAspect() const { return myHasOwnDimensionAspect; }
|
||||
Standard_Boolean HasOwnDimensionAspect() const { return !myDimensionAspect.IsNull(); }
|
||||
|
||||
//! Sets dimension length model units for computing of dimension presentation.
|
||||
//! The method sets value owned by the drawer that will be used during
|
||||
@@ -900,7 +909,7 @@ public:
|
||||
public:
|
||||
|
||||
//! Returns the drawer to which the current object references.
|
||||
const Handle(Prs3d_Drawer)& Link() { return myLink; }
|
||||
const Handle(Prs3d_Drawer)& Link() const { return myLink; }
|
||||
|
||||
//! Returns true if the current object has a link on the other drawer.
|
||||
Standard_Boolean HasLink() const { return !myLink.IsNull(); }
|
||||
@@ -953,19 +962,14 @@ protected:
|
||||
Handle(Prs3d_Drawer) myLink;
|
||||
|
||||
Standard_Integer myNbPoints;
|
||||
Standard_Boolean myHasOwnNbPoints;
|
||||
Standard_Real myMaximalParameterValue;
|
||||
Standard_Boolean myHasOwnMaximalParameterValue;
|
||||
Standard_Real myChordialDeviation;
|
||||
Standard_Boolean myHasOwnChordialDeviation;
|
||||
Aspect_TypeOfDeflection myTypeOfDeflection;
|
||||
Standard_Boolean myHasOwnTypeOfDeflection;
|
||||
Prs3d_TypeOfHLR myTypeOfHLR;
|
||||
Standard_Real myDeviationCoefficient;
|
||||
Standard_Real myPreviousDeviationCoefficient;
|
||||
Standard_Boolean myHasOwnDeviationCoefficient;
|
||||
Standard_Real myDeviationAngle;
|
||||
Standard_Boolean myHasOwnDeviationAngle;
|
||||
Standard_Real myPreviousDeviationAngle;
|
||||
Standard_Boolean myIsoOnPlane;
|
||||
Standard_Boolean myHasOwnIsoOnPlane;
|
||||
@@ -975,57 +979,39 @@ protected:
|
||||
Standard_Boolean myHasOwnIsAutoTriangulated;
|
||||
|
||||
Handle(Prs3d_IsoAspect) myUIsoAspect;
|
||||
Standard_Boolean myHasOwnUIsoAspect;
|
||||
Handle(Prs3d_IsoAspect) myVIsoAspect;
|
||||
Standard_Boolean myHasOwnVIsoAspect;
|
||||
Handle(Prs3d_LineAspect) myWireAspect;
|
||||
Standard_Boolean myHasOwnWireAspect;
|
||||
Standard_Boolean myWireDraw;
|
||||
Standard_Boolean myHasOwnWireDraw;
|
||||
Handle(Prs3d_PointAspect) myPointAspect;
|
||||
Standard_Boolean myHasOwnPointAspect;
|
||||
Handle(Prs3d_LineAspect) myLineAspect;
|
||||
Standard_Boolean myHasOwnLineAspect;
|
||||
Handle(Prs3d_TextAspect) myTextAspect;
|
||||
Standard_Boolean myHasOwnTextAspect;
|
||||
Handle(Prs3d_ShadingAspect) myShadingAspect;
|
||||
Standard_Boolean myHasOwnShadingAspect;
|
||||
Handle(Prs3d_PlaneAspect) myPlaneAspect;
|
||||
Standard_Boolean myHasOwnPlaneAspect;
|
||||
Handle(Prs3d_LineAspect) mySeenLineAspect;
|
||||
Standard_Boolean myHasOwnSeenLineAspect;
|
||||
Handle(Prs3d_ArrowAspect) myArrowAspect;
|
||||
Standard_Boolean myHasOwnArrowAspect;
|
||||
Standard_Boolean myLineArrowDraw;
|
||||
Standard_Boolean myHasOwnLineArrowDraw;
|
||||
Handle(Prs3d_LineAspect) myHiddenLineAspect;
|
||||
Standard_Boolean myHasOwnHiddenLineAspect;
|
||||
Standard_Boolean myDrawHiddenLine;
|
||||
Standard_Boolean myHasOwnDrawHiddenLine;
|
||||
Handle(Prs3d_LineAspect) myVectorAspect;
|
||||
Standard_Boolean myHasOwnVectorAspect;
|
||||
Prs3d_VertexDrawMode myVertexDrawMode;
|
||||
Handle(Prs3d_DatumAspect) myDatumAspect;
|
||||
Standard_Boolean myHasOwnDatumAspect;
|
||||
Handle(Prs3d_LineAspect) mySectionAspect;
|
||||
Standard_Boolean myHasOwnSectionAspect;
|
||||
|
||||
Handle(Prs3d_LineAspect) myFreeBoundaryAspect;
|
||||
Standard_Boolean myHasOwnFreeBoundaryAspect;
|
||||
Standard_Boolean myFreeBoundaryDraw;
|
||||
Standard_Boolean myHasOwnFreeBoundaryDraw;
|
||||
Handle(Prs3d_LineAspect) myUnFreeBoundaryAspect;
|
||||
Standard_Boolean myHasOwnUnFreeBoundaryAspect;
|
||||
Standard_Boolean myUnFreeBoundaryDraw;
|
||||
Standard_Boolean myHasOwnUnFreeBoundaryDraw;
|
||||
Handle(Prs3d_LineAspect) myFaceBoundaryAspect;
|
||||
Standard_Integer myFaceBoundaryUpperContinuity; //!< the most edge continuity class (GeomAbs_Shape) to be included to face boundaries presentation, or -1 if undefined
|
||||
Standard_Boolean myHasOwnFaceBoundaryAspect;
|
||||
Standard_Boolean myFaceBoundaryDraw;
|
||||
Standard_Boolean myHasOwnFaceBoundaryDraw;
|
||||
|
||||
Handle(Prs3d_DimensionAspect) myDimensionAspect;
|
||||
Standard_Boolean myHasOwnDimensionAspect;
|
||||
Prs3d_DimensionUnits myDimensionModelUnits;
|
||||
Standard_Boolean myHasOwnDimLengthModelUnits;
|
||||
Standard_Boolean myHasOwnDimAngleModelUnits;
|
||||
|
@@ -1033,117 +1033,6 @@ static Standard_Integer OCC884 (Draw_Interpretor& di, Standard_Integer argc, con
|
||||
return 0;
|
||||
}
|
||||
|
||||
#include <Graphic3d_MaterialAspect.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_ShadingAspect.hxx>
|
||||
//=======================================================================
|
||||
//function : OCC1174_1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
static Standard_Integer OCC1174_1 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
|
||||
{
|
||||
if (argc != 2)
|
||||
{
|
||||
di << "Usage : " << argv[0] << " shape\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
Handle(AIS_InteractiveContext) anAISContext = ViewerTest::GetAISContext();
|
||||
if(anAISContext.IsNull())
|
||||
{
|
||||
di << "use 'vinit' command before " << argv[0] << "\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
TopoDS_Shape aShape = DBRep::Get(argv[1]);
|
||||
|
||||
Handle(AIS_Shape) anAisIO = new AIS_Shape(aShape);
|
||||
|
||||
Quantity_Color aColF(0.0, 0.4, 0.0, Quantity_TOC_sRGB);
|
||||
Quantity_Color aColB(0.0, 0.0, 0.6, Quantity_TOC_sRGB);
|
||||
|
||||
Handle(Prs3d_Drawer) aDrawer = anAisIO->Attributes();
|
||||
Handle(Prs3d_ShadingAspect) aShadingAspect = aDrawer->ShadingAspect();
|
||||
|
||||
Graphic3d_MaterialAspect aFront = aShadingAspect->Material(Aspect_TOFM_FRONT_SIDE);
|
||||
aFront.SetAmbientColor(aColF);
|
||||
aFront.SetDiffuseColor(aColF);
|
||||
aFront.SetSpecularColor(aColF);
|
||||
aFront.SetEmissiveColor(Quantity_NOC_BLACK);
|
||||
aFront.SetTransparency(0.0);
|
||||
aShadingAspect->SetMaterial(aFront,Aspect_TOFM_FRONT_SIDE);
|
||||
|
||||
Graphic3d_MaterialAspect aBack = aShadingAspect->Material(Aspect_TOFM_BACK_SIDE);
|
||||
aBack.SetAmbientColor(aColB);
|
||||
aBack.SetDiffuseColor(aColB);
|
||||
aBack.SetSpecularColor(aColB);
|
||||
aBack.SetEmissiveColor(Quantity_NOC_BLACK);
|
||||
aBack.SetTransparency(0.0);
|
||||
aShadingAspect->SetMaterial(aBack,Aspect_TOFM_BACK_SIDE);
|
||||
|
||||
aDrawer->SetShadingAspect (aShadingAspect);
|
||||
|
||||
anAISContext->Display (anAisIO, 1, 0, Standard_True);
|
||||
|
||||
Standard_Real r, g, b;
|
||||
aShadingAspect->Color(Aspect_TOFM_FRONT_SIDE).Values(r,g,b, Quantity_TOC_sRGB);
|
||||
di << "Info: color on front side (" << r << "," << g << "," << b << ")\n";
|
||||
aShadingAspect->Color(Aspect_TOFM_BACK_SIDE).Values(r,g,b, Quantity_TOC_sRGB);
|
||||
di << "Info: color on back side (" << r << "," << g << "," << b << ")\n";
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : OCC1174_2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
static Standard_Integer OCC1174_2 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
|
||||
{
|
||||
if (argc != 2)
|
||||
{
|
||||
di << "Usage : " << argv[0] << " shape\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
Handle(AIS_InteractiveContext) AISContext = ViewerTest::GetAISContext();
|
||||
if(AISContext.IsNull())
|
||||
{
|
||||
di << "use 'vinit' command before " << argv[0] << "\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
TopoDS_Shape sh = DBRep::Get(argv[1]);
|
||||
|
||||
Handle(AIS_Shape) ais = new AIS_Shape(sh);
|
||||
AISContext->Display (ais, 1, 0, Standard_False);
|
||||
AISContext->SetMaterial (ais, Graphic3d_NameOfMaterial_ShinyPlastified, Standard_False);
|
||||
|
||||
Quantity_Color colf(0.0, 0.4, 0.0, Quantity_TOC_sRGB);
|
||||
Quantity_Color colb(0.0, 0.0, 0.6, Quantity_TOC_sRGB);
|
||||
Handle(Prs3d_ShadingAspect) sa = ais->Attributes()->ShadingAspect();
|
||||
|
||||
Graphic3d_MaterialAspect front = sa->Material(Aspect_TOFM_FRONT_SIDE);
|
||||
front.SetAmbientColor(colf);
|
||||
front.SetDiffuseColor(colf);
|
||||
front.SetSpecularColor(colf);
|
||||
front.SetEmissiveColor(Quantity_NOC_BLACK);
|
||||
front.SetTransparency (0.4f);
|
||||
sa->SetMaterial(front,Aspect_TOFM_FRONT_SIDE);
|
||||
|
||||
Graphic3d_MaterialAspect back = sa->Material(Aspect_TOFM_BACK_SIDE);
|
||||
back.SetAmbientColor(colb);
|
||||
back.SetDiffuseColor(colb);
|
||||
back.SetSpecularColor(colb);
|
||||
back.SetEmissiveColor(Quantity_NOC_BLACK);
|
||||
back.SetTransparency (0.2f);
|
||||
sa->SetMaterial(back,Aspect_TOFM_BACK_SIDE);
|
||||
|
||||
AISContext->Redisplay (ais, 1, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#include <TopoDS_Solid.hxx>
|
||||
#include <BRepFeat_MakeDPrism.hxx>
|
||||
//=======================================================================
|
||||
@@ -1503,9 +1392,6 @@ void QABugs::Commands_17(Draw_Interpretor& theCommands) {
|
||||
theCommands.Add ("OCC814", "OCC814", __FILE__, OCC814, group);
|
||||
theCommands.Add ("OCC884", "OCC884 result shape [toler [maxtoler]]", __FILE__, OCC884, group);
|
||||
|
||||
theCommands.Add ("OCC1174_1", "OCC1174_1 shape", __FILE__, OCC1174_1, group);
|
||||
theCommands.Add ("OCC1174_2", "OCC1174_2 shape", __FILE__, OCC1174_2, group);
|
||||
|
||||
theCommands.Add ("OCCN1", "OCCN1 angle fuse(1 for boss / 0 for slot) length", __FILE__, OCCN1, group);
|
||||
theCommands.Add ("OCCN2", "OCCN2", __FILE__, OCCN2, group);
|
||||
|
||||
|
@@ -66,7 +66,8 @@ namespace
|
||||
//purpose :
|
||||
//=============================================================================
|
||||
V3d_View::V3d_View (const Handle(V3d_Viewer)& theViewer, const V3d_TypeOfView theType)
|
||||
: myIsInvalidatedImmediate (Standard_True),
|
||||
: myImmediateUpdate (Standard_False),
|
||||
myIsInvalidatedImmediate (Standard_True),
|
||||
MyViewer (theViewer.operator->()),
|
||||
SwitchSetFront (Standard_False),
|
||||
myZRotation (Standard_False),
|
||||
@@ -90,7 +91,6 @@ V3d_View::V3d_View (const Handle(V3d_Viewer)& theViewer, const V3d_TypeOfView th
|
||||
|
||||
myDefaultCamera = new Graphic3d_Camera();
|
||||
|
||||
myImmediateUpdate = Standard_False;
|
||||
SetAutoZFitMode (Standard_True, 1.0);
|
||||
SetBackFacingModel (V3d_TOBM_AUTOMATIC);
|
||||
SetCamera (aCamera);
|
||||
@@ -107,7 +107,6 @@ V3d_View::V3d_View (const Handle(V3d_Viewer)& theViewer, const V3d_TypeOfView th
|
||||
SetViewOrientationDefault();
|
||||
theViewer->AddView (this);
|
||||
Init();
|
||||
myImmediateUpdate = Standard_True;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
@@ -115,7 +114,8 @@ V3d_View::V3d_View (const Handle(V3d_Viewer)& theViewer, const V3d_TypeOfView th
|
||||
//purpose :
|
||||
//=============================================================================
|
||||
V3d_View::V3d_View (const Handle(V3d_Viewer)& theViewer, const Handle(V3d_View)& theView)
|
||||
: myIsInvalidatedImmediate (Standard_True),
|
||||
: myImmediateUpdate (Standard_False),
|
||||
myIsInvalidatedImmediate (Standard_True),
|
||||
MyViewer (theViewer.operator->()),
|
||||
SwitchSetFront(Standard_False),
|
||||
myZRotation (Standard_False),
|
||||
@@ -129,11 +129,9 @@ V3d_View::V3d_View (const Handle(V3d_Viewer)& theViewer, const Handle(V3d_View)&
|
||||
|
||||
myDefaultCamera = new Graphic3d_Camera (theView->DefaultCamera());
|
||||
|
||||
myImmediateUpdate = Standard_False;
|
||||
SetAutoZFitMode (theView->AutoZFitMode(), theView->AutoZFitScaleFactor());
|
||||
theViewer->AddView (this);
|
||||
Init();
|
||||
myImmediateUpdate = Standard_True;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
@@ -990,7 +988,8 @@ void V3d_View::SetEye(const Standard_Real X,const Standard_Real Y,const Standard
|
||||
{
|
||||
Standard_Real aTwistBefore = Twist();
|
||||
|
||||
Standard_Boolean wasUpdateEnabled = SetImmediateUpdate (Standard_False);
|
||||
const Standard_Boolean wasUpdateEnabled = myImmediateUpdate;
|
||||
myImmediateUpdate = Standard_False;
|
||||
|
||||
Handle(Graphic3d_Camera) aCamera = Camera();
|
||||
|
||||
@@ -998,7 +997,7 @@ void V3d_View::SetEye(const Standard_Real X,const Standard_Real Y,const Standard
|
||||
|
||||
SetTwist (aTwistBefore);
|
||||
|
||||
SetImmediateUpdate (wasUpdateEnabled);
|
||||
myImmediateUpdate = wasUpdateEnabled;
|
||||
|
||||
ImmediateUpdate();
|
||||
}
|
||||
@@ -1042,13 +1041,14 @@ void V3d_View::SetProj( const Standard_Real Vx,const Standard_Real Vy, const Sta
|
||||
|
||||
Standard_Real aTwistBefore = Twist();
|
||||
|
||||
Standard_Boolean wasUpdateEnabled = SetImmediateUpdate (Standard_False);
|
||||
const Standard_Boolean wasUpdateEnabled = myImmediateUpdate;
|
||||
myImmediateUpdate = Standard_False;
|
||||
|
||||
Camera()->SetDirection (gp_Dir (Vx, Vy, Vz).Reversed());
|
||||
|
||||
SetTwist(aTwistBefore);
|
||||
|
||||
SetImmediateUpdate (wasUpdateEnabled);
|
||||
myImmediateUpdate = wasUpdateEnabled;
|
||||
|
||||
ImmediateUpdate();
|
||||
}
|
||||
@@ -1107,13 +1107,14 @@ void V3d_View::SetAt(const Standard_Real X,const Standard_Real Y,const Standard_
|
||||
{
|
||||
Standard_Real aTwistBefore = Twist();
|
||||
|
||||
Standard_Boolean wasUpdateEnabled = SetImmediateUpdate (Standard_False);
|
||||
const Standard_Boolean wasUpdateEnabled = myImmediateUpdate;
|
||||
myImmediateUpdate = Standard_False;
|
||||
|
||||
Camera()->SetCenter (gp_Pnt (X, Y, Z));
|
||||
|
||||
SetTwist (aTwistBefore);
|
||||
|
||||
SetImmediateUpdate (wasUpdateEnabled);
|
||||
myImmediateUpdate = wasUpdateEnabled;
|
||||
|
||||
ImmediateUpdate();
|
||||
}
|
||||
@@ -1513,7 +1514,8 @@ void V3d_View::WindowFit (const Standard_Integer theMinXp,
|
||||
const Standard_Integer theMaxXp,
|
||||
const Standard_Integer theMaxYp)
|
||||
{
|
||||
Standard_Boolean wasUpdateEnabled = SetImmediateUpdate (Standard_False);
|
||||
const Standard_Boolean wasUpdateEnabled = myImmediateUpdate;
|
||||
myImmediateUpdate = Standard_False;
|
||||
|
||||
Handle(Graphic3d_Camera) aCamera = Camera();
|
||||
|
||||
@@ -1559,7 +1561,7 @@ void V3d_View::WindowFit (const Standard_Integer theMinXp,
|
||||
FitAll (aX1, aY1, aX2, aY2);
|
||||
}
|
||||
|
||||
SetImmediateUpdate (wasUpdateEnabled);
|
||||
myImmediateUpdate = wasUpdateEnabled;
|
||||
|
||||
ImmediateUpdate();
|
||||
}
|
||||
@@ -2363,7 +2365,8 @@ void V3d_View::Panning (const Standard_Real theDXv,
|
||||
myCamStartOpCenter = aCamera->Center();
|
||||
}
|
||||
|
||||
Standard_Boolean wasUpdateEnabled = SetImmediateUpdate (Standard_False);
|
||||
const Standard_Boolean wasUpdateEnabled = myImmediateUpdate;
|
||||
myImmediateUpdate = Standard_False;
|
||||
|
||||
gp_Pnt aViewDims = aCamera->ViewDimensions();
|
||||
|
||||
@@ -2372,7 +2375,7 @@ void V3d_View::Panning (const Standard_Real theDXv,
|
||||
Translate (aCamera, -theDXv, -theDYv);
|
||||
Scale (aCamera, aViewDims.X() / theZoomFactor, aViewDims.Y() / theZoomFactor);
|
||||
|
||||
SetImmediateUpdate (wasUpdateEnabled);
|
||||
myImmediateUpdate = wasUpdateEnabled;
|
||||
|
||||
ImmediateUpdate();
|
||||
}
|
||||
@@ -2416,7 +2419,8 @@ void V3d_View::ZoomAtPoint (const Standard_Integer theMouseStartX,
|
||||
const Standard_Integer theMouseEndX,
|
||||
const Standard_Integer theMouseEndY)
|
||||
{
|
||||
Standard_Boolean wasUpdateEnabled = SetImmediateUpdate (Standard_False);
|
||||
const Standard_Boolean wasUpdateEnabled = myImmediateUpdate;
|
||||
myImmediateUpdate = Standard_False;
|
||||
|
||||
// zoom
|
||||
Standard_Real aDxy = Standard_Real ((theMouseEndX + theMouseEndY) - (theMouseStartX + theMouseStartY));
|
||||
@@ -2459,7 +2463,7 @@ void V3d_View::ZoomAtPoint (const Standard_Integer theMouseStartX,
|
||||
aCamera->SetScale (aCamera->Scale() / aCoef);
|
||||
Translate (aCamera, aZoomAtPointXv - aDxv, aZoomAtPointYv - aDyv);
|
||||
|
||||
SetImmediateUpdate (wasUpdateEnabled);
|
||||
myImmediateUpdate = wasUpdateEnabled;
|
||||
|
||||
ImmediateUpdate();
|
||||
}
|
||||
|
@@ -265,9 +265,6 @@ public:
|
||||
//! Returns TRUE when the light is active in this view.
|
||||
Standard_EXPORT Standard_Boolean IsActiveLight (const Handle(V3d_Light)& theLight) const;
|
||||
|
||||
//! sets the immediate update mode and returns the previous one.
|
||||
Standard_EXPORT Standard_Boolean SetImmediateUpdate (const Standard_Boolean theImmediateUpdate);
|
||||
|
||||
//! Returns trihedron object.
|
||||
const Handle(V3d_Trihedron)& Trihedron (bool theToCreate = true)
|
||||
{
|
||||
@@ -948,6 +945,10 @@ public:
|
||||
|
||||
public: //! @name deprecated methods
|
||||
|
||||
//! sets the immediate update mode and returns the previous one.
|
||||
Standard_DEPRECATED ("Deprecated method - ImmediateUpdate will be removed")
|
||||
Standard_EXPORT Standard_Boolean SetImmediateUpdate (const Standard_Boolean theImmediateUpdate);
|
||||
|
||||
//! Returns True if One light more can be
|
||||
//! activated in this View.
|
||||
Standard_DEPRECATED ("Deprecated method - ActiveLights() should be used instead")
|
||||
|
@@ -116,11 +116,13 @@ void V3d_Viewer::SetViewOn (const Handle(V3d_View)& theView)
|
||||
theView->SetGrid (myPrivilegedPlane, aGrid);
|
||||
theView->SetGridActivity (aGrid->IsActive());
|
||||
}
|
||||
Standard_DISABLE_DEPRECATION_WARNINGS
|
||||
if (theView->SetImmediateUpdate (Standard_False))
|
||||
{
|
||||
theView->Redraw();
|
||||
theView->SetImmediateUpdate (Standard_True);
|
||||
}
|
||||
Standard_ENABLE_DEPRECATION_WARNINGS
|
||||
}
|
||||
|
||||
// ========================================================================
|
||||
|
@@ -1199,7 +1199,9 @@ static Standard_Integer VDump (Draw_Interpretor& theDI,
|
||||
case Graphic3d_BT_Red: aFormat = Image_Format_Gray; break;
|
||||
}
|
||||
|
||||
Standard_DISABLE_DEPRECATION_WARNINGS
|
||||
const bool wasImmUpdate = aView->SetImmediateUpdate (false);
|
||||
Standard_ENABLE_DEPRECATION_WARNINGS
|
||||
Handle(Graphic3d_Camera) aCamBack = aView->Camera();
|
||||
if (!aCustomCam.IsNull())
|
||||
{
|
||||
@@ -1277,7 +1279,9 @@ static Standard_Integer VDump (Draw_Interpretor& theDI,
|
||||
{
|
||||
aView->SetCamera (aCamBack);
|
||||
}
|
||||
Standard_DISABLE_DEPRECATION_WARNINGS
|
||||
aView->SetImmediateUpdate (wasImmUpdate);
|
||||
Standard_ENABLE_DEPRECATION_WARNINGS
|
||||
|
||||
if (!aPixMap.Save (aFilePath))
|
||||
{
|
||||
|
@@ -28,7 +28,9 @@ ViewerTest_AutoUpdater::ViewerTest_AutoUpdater (const Handle(AIS_InteractiveCont
|
||||
{
|
||||
if (!theView.IsNull())
|
||||
{
|
||||
Standard_DISABLE_DEPRECATION_WARNINGS
|
||||
myWasAutoUpdate = theView->SetImmediateUpdate (Standard_False);
|
||||
Standard_ENABLE_DEPRECATION_WARNINGS
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +76,9 @@ void ViewerTest_AutoUpdater::Invalidate()
|
||||
if (myWasAutoUpdate
|
||||
&& !myView.IsNull())
|
||||
{
|
||||
Standard_DISABLE_DEPRECATION_WARNINGS
|
||||
myView->SetImmediateUpdate (myWasAutoUpdate);
|
||||
Standard_ENABLE_DEPRECATION_WARNINGS
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +90,9 @@ void ViewerTest_AutoUpdater::Update()
|
||||
{
|
||||
if (!myView.IsNull())
|
||||
{
|
||||
Standard_DISABLE_DEPRECATION_WARNINGS
|
||||
myView->SetImmediateUpdate (myWasAutoUpdate);
|
||||
Standard_ENABLE_DEPRECATION_WARNINGS
|
||||
}
|
||||
|
||||
switch (myToUpdate)
|
||||
@@ -96,13 +102,6 @@ void ViewerTest_AutoUpdater::Update()
|
||||
return;
|
||||
}
|
||||
case ViewerTest_AutoUpdater::RedrawMode_Auto:
|
||||
{
|
||||
if (!myWasAutoUpdate)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
Standard_FALLTHROUGH
|
||||
case ViewerTest_AutoUpdater::RedrawMode_Forced:
|
||||
{
|
||||
if (!myContext.IsNull())
|
||||
|
@@ -5026,7 +5026,7 @@ static Standard_Integer VTriangle (Draw_Interpretor& /*di*/,
|
||||
if (!isTri)
|
||||
{
|
||||
aPrs->Attributes()->SetupOwnShadingAspect();
|
||||
aPrs->Attributes()->ShadingAspect()->Aspect()->SetColor (aPrs->Attributes()->LineAspect()->Aspect()->Color());
|
||||
aPrs->Attributes()->ShadingAspect()->Aspect()->SetColor (Quantity_NOC_YELLOW);
|
||||
}
|
||||
ViewerTest::Display (argv[1], aPrs);
|
||||
return 0;
|
||||
|
@@ -925,7 +925,9 @@ static Standard_Integer VListColors (Draw_Interpretor& theDI,
|
||||
{
|
||||
ViewerTest::ViewerInit (0, 0, anImgParams.Width, anImgParams.Height, "TmpDriver/TmpViewer/TmpView");
|
||||
aView = ViewerTest::CurrentView();
|
||||
Standard_DISABLE_DEPRECATION_WARNINGS
|
||||
aView->SetImmediateUpdate (false);
|
||||
Standard_ENABLE_DEPRECATION_WARNINGS
|
||||
aView->SetBgGradientStyle (Aspect_GradientFillMethod_None, false);
|
||||
}
|
||||
|
||||
@@ -964,7 +966,9 @@ static Standard_Integer VListColors (Draw_Interpretor& theDI,
|
||||
const TCollection_AsciiString anImgPath = aFileNameBase + "_" + aColName + ".png";
|
||||
if (!aView.IsNull())
|
||||
{
|
||||
Standard_DISABLE_DEPRECATION_WARNINGS
|
||||
aView->SetImmediateUpdate (false);
|
||||
Standard_ENABLE_DEPRECATION_WARNINGS
|
||||
aView->SetBackgroundColor (aCol);
|
||||
if (!aView->ToPixMap (anImg, anImgParams)
|
||||
|| !anImg.Save (aFolder + anImgPath))
|
||||
|
@@ -7645,7 +7645,9 @@ static Standard_Integer VAnimation (Draw_Interpretor& theDI,
|
||||
}
|
||||
|
||||
// Perform video recording
|
||||
Standard_DISABLE_DEPRECATION_WARNINGS
|
||||
const Standard_Boolean wasImmediateUpdate = aView->SetImmediateUpdate (Standard_False);
|
||||
Standard_ENABLE_DEPRECATION_WARNINGS
|
||||
const Standard_Real anUpperPts = aPlayStartTime + aPlayDuration;
|
||||
anAnimation->StartTimer (aPlayStartTime, aPlaySpeed, Standard_True, aPlayDuration <= 0.0);
|
||||
|
||||
@@ -7736,7 +7738,9 @@ static Standard_Integer VAnimation (Draw_Interpretor& theDI,
|
||||
<< "Nb. Frames: " << Standard_Real(aNbFrames);
|
||||
|
||||
aView->Redraw();
|
||||
Standard_DISABLE_DEPRECATION_WARNINGS
|
||||
aView->SetImmediateUpdate (wasImmediateUpdate);
|
||||
Standard_ENABLE_DEPRECATION_WARNINGS
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -13159,7 +13163,9 @@ static int VDumpSelectionImage (Draw_Interpretor& /*theDi*/,
|
||||
return 1;
|
||||
}
|
||||
|
||||
Standard_DISABLE_DEPRECATION_WARNINGS
|
||||
const bool wasImmUpdate = aView->SetImmediateUpdate (false);
|
||||
Standard_ENABLE_DEPRECATION_WARNINGS
|
||||
Handle(Graphic3d_Camera) aCamBack = aView->Camera();
|
||||
if (!aCustomCam.IsNull())
|
||||
{
|
||||
@@ -13174,8 +13180,9 @@ static int VDumpSelectionImage (Draw_Interpretor& /*theDi*/,
|
||||
{
|
||||
aView->SetCamera (aCamBack);
|
||||
}
|
||||
Standard_DISABLE_DEPRECATION_WARNINGS
|
||||
aView->SetImmediateUpdate (wasImmUpdate);
|
||||
|
||||
Standard_ENABLE_DEPRECATION_WARNINGS
|
||||
if (!aPixMap.Save (aFile))
|
||||
{
|
||||
Message::SendFail ("Error: can't save selection image");
|
||||
|
@@ -1,68 +0,0 @@
|
||||
puts "================"
|
||||
puts "OCC1174: Impossible to set different properties for different sides of a (sur)face"
|
||||
puts "================"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION QAcommands
|
||||
|
||||
set x 200
|
||||
set y 200
|
||||
|
||||
set Black_R 0
|
||||
set Black_G 0
|
||||
set Black_B 0
|
||||
|
||||
restore [locate_data_file OCC1174.brep] a
|
||||
vinit View1
|
||||
OCC1174_1 a
|
||||
vdisplay a
|
||||
vfit
|
||||
|
||||
set scale 2.50501
|
||||
set proj_X 0.672033
|
||||
set proj_Y -0.721033
|
||||
set proj_Z 0.168771
|
||||
set up_X -0.131494
|
||||
set up_Y 0.108095
|
||||
set up_Z 0.985406
|
||||
set at_X 102.061817325836
|
||||
set at_Y 169.436979868935
|
||||
set at_Z 70.7572056943368
|
||||
|
||||
vviewparams -scale ${scale} -proj ${proj_X} ${proj_Y} ${proj_Z} -up ${up_X} ${up_Y} ${up_Z} -at ${at_X} ${at_Y} ${at_Z}
|
||||
|
||||
set x_GREEN 300
|
||||
set y_GREEN 180
|
||||
|
||||
set x_BLUE 180
|
||||
set y_BLUE 250
|
||||
|
||||
set ColorList1 [vreadpixel ${x_GREEN} ${y_GREEN} rgb]
|
||||
set RED_1 [lindex $ColorList1 0]
|
||||
set GREEN_1 [lindex $ColorList1 1]
|
||||
set BLUE_1 [lindex $ColorList1 2]
|
||||
|
||||
set ColorList2 [vreadpixel ${x_BLUE} ${y_BLUE} rgb]
|
||||
set RED_2 [lindex $ColorList2 0]
|
||||
set GREEN_2 [lindex $ColorList2 1]
|
||||
set BLUE_2 [lindex $ColorList2 2]
|
||||
|
||||
if {${RED_1} == 0 && ${GREEN_1} > 0 && ${BLUE_1} == 0} {
|
||||
set IsGreen 1
|
||||
} else {
|
||||
set IsGreen 0
|
||||
}
|
||||
|
||||
if {${RED_2} == 0 && ${GREEN_2} == 0 && ${BLUE_2} > 0} {
|
||||
set IsBlue 1
|
||||
} else {
|
||||
set IsBlue 0
|
||||
}
|
||||
|
||||
if {${IsGreen} == 1 && ${IsBlue} == 1} {
|
||||
puts "OCC1174: OK"
|
||||
} else {
|
||||
puts "OCC1174: Error"
|
||||
}
|
||||
|
||||
vdump $imagedir/${casename}.png
|
Reference in New Issue
Block a user