mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-21 10:13:43 +03:00
0032704: Visualization, Prs3d_Drawer - do not implicitly create aspects within getters
Prs3d_Drawer getters now return NULL instead of implicitly creating "default" aspects. Added missing initialization of default properties in AIS_InteractiveContext. AIS_InteractiveContext::setContextToObject() - added missing propagation of Context to child presentations.
This commit is contained in:
parent
65acdce54c
commit
4f5e934445
dox/upgrade
samples/mfc/standard/01_Geometry/src
src
AIS
IVtkDraw
IVtkOCC
Prs3d
QABugs
ViewerTest
tests/v3d/bugs
@ -2312,3 +2312,9 @@ BRepLib_ValidateEdge aValidateEdge(myHCurve, ACS, SameParameter);
|
|||||||
aValidateEdge.SetParallel(toRunParallel);
|
aValidateEdge.SetParallel(toRunParallel);
|
||||||
aValidateEdge.Process();
|
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.
|
||||||
|
@ -983,6 +983,7 @@ if(NbResults>0){ \n\
|
|||||||
|
|
||||||
Handle(ISession_Surface) aSurface = new ISession_Surface(SP);
|
Handle(ISession_Surface) aSurface = new ISession_Surface(SP);
|
||||||
Handle(Prs3d_Drawer) CurDrawer = aSurface->Attributes();
|
Handle(Prs3d_Drawer) CurDrawer = aSurface->Attributes();
|
||||||
|
CurDrawer->SetOwnLineAspects();
|
||||||
CurDrawer->UIsoAspect()->SetNumber(10);
|
CurDrawer->UIsoAspect()->SetNumber(10);
|
||||||
CurDrawer->VIsoAspect()->SetNumber(10);
|
CurDrawer->VIsoAspect()->SetNumber(10);
|
||||||
aDoc->GetAISContext()->SetLocalAttributes(aSurface, CurDrawer, Standard_False);
|
aDoc->GetAISContext()->SetLocalAttributes(aSurface, CurDrawer, Standard_False);
|
||||||
|
@ -51,7 +51,7 @@ ISession_Direction::ISession_Direction (const gp_Pnt2d& aPnt2d,
|
|||||||
myDir (gp_Dir(aDir2d.X(),aDir2d.Y(),0.0)),
|
myDir (gp_Dir(aDir2d.X(),aDir2d.Y(),0.0)),
|
||||||
myLength (aLength)
|
myLength (aLength)
|
||||||
{
|
{
|
||||||
myArrowLength = myDrawer->ArrowAspect()->Length();
|
myArrowLength = 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ISession_Direction::ISession_Direction (const gp_Pnt2d& aPnt2d,
|
ISession_Direction::ISession_Direction (const gp_Pnt2d& aPnt2d,
|
||||||
@ -60,7 +60,7 @@ ISession_Direction::ISession_Direction (const gp_Pnt2d& aPnt2d,
|
|||||||
myDir (gp_Dir(aVec2d.X(), aVec2d.Y(), 0.0))
|
myDir (gp_Dir(aVec2d.X(), aVec2d.Y(), 0.0))
|
||||||
{
|
{
|
||||||
myLength = aVec2d.Magnitude();
|
myLength = aVec2d.Magnitude();
|
||||||
myArrowLength = myDrawer->ArrowAspect()->Length();
|
myArrowLength = 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ void ISession_Surface::Compute (const Handle(PrsMgr_PresentationManager)& ,
|
|||||||
Handle(GeomAdaptor_Surface) anAdaptorHSurface = new GeomAdaptor_Surface (mySurface);
|
Handle(GeomAdaptor_Surface) anAdaptorHSurface = new GeomAdaptor_Surface (mySurface);
|
||||||
|
|
||||||
Handle(Prs3d_Drawer) aPoleDrawer = new Prs3d_Drawer();
|
Handle(Prs3d_Drawer) aPoleDrawer = new Prs3d_Drawer();
|
||||||
|
aPoleDrawer->SetOwnLineAspects();
|
||||||
aPoleDrawer->SetLineAspect (new Prs3d_LineAspect (Quantity_NOC_YELLOW3, Aspect_TOL_SOLID, 1.0));
|
aPoleDrawer->SetLineAspect (new Prs3d_LineAspect (Quantity_NOC_YELLOW3, Aspect_TOL_SOLID, 1.0));
|
||||||
switch (theMode)
|
switch (theMode)
|
||||||
{
|
{
|
||||||
|
@ -128,6 +128,7 @@ myIsAutoActivateSelMode(Standard_True)
|
|||||||
myStyles[Prs3d_TypeOfHighlight_LocalDynamic] = new Prs3d_Drawer();
|
myStyles[Prs3d_TypeOfHighlight_LocalDynamic] = new Prs3d_Drawer();
|
||||||
myStyles[Prs3d_TypeOfHighlight_SubIntensity] = new Prs3d_Drawer();
|
myStyles[Prs3d_TypeOfHighlight_SubIntensity] = new Prs3d_Drawer();
|
||||||
|
|
||||||
|
myDefaultDrawer->SetupOwnDefaults();
|
||||||
myDefaultDrawer->SetZLayer(Graphic3d_ZLayerId_Default);
|
myDefaultDrawer->SetZLayer(Graphic3d_ZLayerId_Default);
|
||||||
myDefaultDrawer->SetDisplayMode(0);
|
myDefaultDrawer->SetDisplayMode(0);
|
||||||
{
|
{
|
||||||
@ -704,11 +705,15 @@ void AIS_InteractiveContext::HilightWithColor(const Handle(AIS_InteractiveObject
|
|||||||
const Standard_Boolean theIsToUpdate)
|
const Standard_Boolean theIsToUpdate)
|
||||||
{
|
{
|
||||||
if (theObj.IsNull())
|
if (theObj.IsNull())
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
setContextToObject (theObj);
|
setContextToObject (theObj);
|
||||||
if (!myObjects.IsBound (theObj))
|
if (!myObjects.IsBound (theObj))
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const Handle(AIS_GlobalStatus)& aStatus = myObjects (theObj);
|
const Handle(AIS_GlobalStatus)& aStatus = myObjects (theObj);
|
||||||
aStatus->SetHilightStatus (Standard_True);
|
aStatus->SetHilightStatus (Standard_True);
|
||||||
@ -720,7 +725,9 @@ void AIS_InteractiveContext::HilightWithColor(const Handle(AIS_InteractiveObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (theIsToUpdate)
|
if (theIsToUpdate)
|
||||||
|
{
|
||||||
myMainVwr->Update();
|
myMainVwr->Update();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -2300,6 +2307,33 @@ gp_Pnt AIS_InteractiveContext::GravityPoint (const Handle(V3d_View)& theView) co
|
|||||||
return theView->GravityPoint();
|
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
|
//function : setObjectStatus
|
||||||
//purpose :
|
//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.
|
//! Assign the context to the object or throw exception if object was already assigned to another context.
|
||||||
void setContextToObject (const Handle(AIS_InteractiveObject)& theObj)
|
Standard_EXPORT 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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//! Return display mode for highlighting.
|
//! Return display mode for highlighting.
|
||||||
Standard_Integer getHilightMode (const Handle(AIS_InteractiveObject)& theObj,
|
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);
|
StdSelect::SetDrawerForBRepOwner(aSelection,myDrawer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AIS_Shape::Color( Quantity_Color& aColor ) const {
|
void AIS_Shape::Color (Quantity_Color& theColor) const
|
||||||
aColor = myDrawer->ShadingAspect()->Color(myCurrentFacingModel);
|
{
|
||||||
|
if (const Handle(Prs3d_ShadingAspect)& aShading = myDrawer->ShadingAspect())
|
||||||
|
{
|
||||||
|
theColor = myDrawer->ShadingAspect()->Color(myCurrentFacingModel);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Graphic3d_NameOfMaterial AIS_Shape::Material() const {
|
Graphic3d_NameOfMaterial AIS_Shape::Material() const
|
||||||
return (myDrawer->ShadingAspect()->Material(myCurrentFacingModel)).Name();
|
{
|
||||||
|
const Handle(Prs3d_ShadingAspect)& aShading = myDrawer->ShadingAspect();
|
||||||
|
return !aShading.IsNull()
|
||||||
|
? aShading->Material(myCurrentFacingModel).Name()
|
||||||
|
: Graphic3d_NameOfMaterial_DEFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_Real AIS_Shape::Transparency() const {
|
Standard_Real AIS_Shape::Transparency() const
|
||||||
return myDrawer->ShadingAspect()->Transparency(myCurrentFacingModel);
|
{
|
||||||
|
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 theToKeepColor,
|
||||||
const Standard_Boolean theToKeepTransp) const
|
const Standard_Boolean theToKeepTransp) const
|
||||||
{
|
{
|
||||||
|
theDrawer->SetupOwnShadingAspect();
|
||||||
|
|
||||||
const Quantity_Color aColor = theDrawer->ShadingAspect()->Color (myCurrentFacingModel);
|
const Quantity_Color aColor = theDrawer->ShadingAspect()->Color (myCurrentFacingModel);
|
||||||
const Standard_Real aTransp = theDrawer->ShadingAspect()->Transparency (myCurrentFacingModel);
|
const Standard_Real aTransp = theDrawer->ShadingAspect()->Transparency (myCurrentFacingModel);
|
||||||
theDrawer->SetupOwnShadingAspect();
|
|
||||||
theDrawer->ShadingAspect()->SetMaterial (theMaterial, myCurrentFacingModel);
|
theDrawer->ShadingAspect()->SetMaterial (theMaterial, myCurrentFacingModel);
|
||||||
|
|
||||||
if (theToKeepColor)
|
if (theToKeepColor)
|
||||||
|
@ -171,6 +171,7 @@ static Handle(PipelinePtr) PipelineByActorName (const TCollection_AsciiString& t
|
|||||||
static Handle(Prs3d_Drawer) createDefaultDrawer()
|
static Handle(Prs3d_Drawer) createDefaultDrawer()
|
||||||
{
|
{
|
||||||
Handle(Prs3d_Drawer) aGlobalDrawer = new Prs3d_Drawer();
|
Handle(Prs3d_Drawer) aGlobalDrawer = new Prs3d_Drawer();
|
||||||
|
aGlobalDrawer->SetupOwnDefaults();
|
||||||
aGlobalDrawer->SetTypeOfDeflection (Aspect_TOD_RELATIVE);
|
aGlobalDrawer->SetTypeOfDeflection (Aspect_TOD_RELATIVE);
|
||||||
aGlobalDrawer->SetDeviationCoefficient (0.0001);
|
aGlobalDrawer->SetDeviationCoefficient (0.0001);
|
||||||
return aGlobalDrawer;
|
return aGlobalDrawer;
|
||||||
|
@ -36,6 +36,7 @@ IVtkOCC_Shape::IVtkOCC_Shape (const TopoDS_Shape& theShape,
|
|||||||
{
|
{
|
||||||
// these old defaults have been moved from IVtkOCC_ShapeMesher constructor
|
// these old defaults have been moved from IVtkOCC_ShapeMesher constructor
|
||||||
myOCCTDrawer->SetDeviationCoefficient (0.0001); // Aspect_TOD_RELATIVE
|
myOCCTDrawer->SetDeviationCoefficient (0.0001); // Aspect_TOD_RELATIVE
|
||||||
|
myOCCTDrawer->SetupOwnDefaults();
|
||||||
}
|
}
|
||||||
buildSubShapeIdMap();
|
buildSubShapeIdMap();
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -55,6 +55,9 @@ public:
|
|||||||
//! Default constructor.
|
//! Default constructor.
|
||||||
Standard_EXPORT Prs3d_Drawer();
|
Standard_EXPORT Prs3d_Drawer();
|
||||||
|
|
||||||
|
//! Setup all own aspects with default values.
|
||||||
|
Standard_EXPORT void SetupOwnDefaults();
|
||||||
|
|
||||||
//! Sets the type of chordal deflection.
|
//! Sets the type of chordal deflection.
|
||||||
//! This indicates whether the deflection value is absolute or relative to the size of the object.
|
//! This indicates whether the deflection value is absolute or relative to the size of the object.
|
||||||
Standard_EXPORT void SetTypeOfDeflection (const Aspect_TypeOfDeflection theTypeOfDeflection);
|
Standard_EXPORT void SetTypeOfDeflection (const Aspect_TypeOfDeflection theTypeOfDeflection);
|
||||||
@ -83,58 +86,66 @@ public:
|
|||||||
//! Prs3d_DeflectionCurve
|
//! Prs3d_DeflectionCurve
|
||||||
//! Prs3d_WFDeflectionSurface
|
//! Prs3d_WFDeflectionSurface
|
||||||
//! Prs3d_WFDeflectionRestrictedFace
|
//! 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.
|
//! Drawings of curves or patches are made with respect to an absolute maximal chordal deviation.
|
||||||
Standard_Real MaximalChordialDeviation() const
|
Standard_Real MaximalChordialDeviation() const
|
||||||
{
|
{
|
||||||
return myHasOwnChordialDeviation || myLink.IsNull()
|
return myChordialDeviation > 0.0
|
||||||
? myChordialDeviation
|
? myChordialDeviation
|
||||||
: myLink->MaximalChordialDeviation();
|
: (!myLink.IsNull()
|
||||||
|
? myLink->MaximalChordialDeviation()
|
||||||
|
: 0.0001);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns true if the drawer has a maximal chordial deviation setting active.
|
//! 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().
|
//! Resets HasOwnMaximalChordialDeviation() flag, e.g. undoes SetMaximalChordialDeviation().
|
||||||
void UnsetOwnMaximalChordialDeviation()
|
void UnsetOwnMaximalChordialDeviation()
|
||||||
{
|
{
|
||||||
myHasOwnChordialDeviation = false;
|
myChordialDeviation = -1.0;
|
||||||
myChordialDeviation = 0.0001;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Sets the type of HLR algorithm used by drawer's interactive objects
|
//! Sets the type of HLR algorithm used by drawer's interactive objects
|
||||||
Standard_EXPORT void SetTypeOfHLR (const Prs3d_TypeOfHLR theTypeOfHLR);
|
Standard_EXPORT void SetTypeOfHLR (const Prs3d_TypeOfHLR theTypeOfHLR);
|
||||||
|
|
||||||
//! Returns the type of HLR algorithm currently in use.
|
//! 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.
|
//! Returns true if the type of HLR is not equal to Prs3d_TOH_NotSet.
|
||||||
Standard_Boolean HasOwnTypeOfHLR() const { return (myTypeOfHLR != Prs3d_TOH_NotSet); }
|
Standard_Boolean HasOwnTypeOfHLR() const { return (myTypeOfHLR != Prs3d_TOH_NotSet); }
|
||||||
|
|
||||||
//! Defines the maximum value allowed for the first and last
|
//! Defines the maximum value allowed for the first and last
|
||||||
//! parameters of an infinite curve.
|
//! 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
|
//! Sets the maximum value allowed for the first and last parameters of an infinite curve.
|
||||||
//! parameters of an infinite curve. By default, this value is 500000.
|
//! By default, this value is 500000.
|
||||||
Standard_Real MaximalParameterValue() const
|
Standard_Real MaximalParameterValue() const
|
||||||
{
|
{
|
||||||
return myHasOwnMaximalParameterValue || myLink.IsNull()
|
return myMaximalParameterValue > 0.0
|
||||||
? myMaximalParameterValue
|
? myMaximalParameterValue
|
||||||
: myLink->MaximalParameterValue();
|
: (!myLink.IsNull()
|
||||||
|
? myLink->MaximalParameterValue()
|
||||||
|
: 500000.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns true if the drawer has a maximum value allowed for the first and last
|
//! Returns true if the drawer has a maximum value allowed for the first and last
|
||||||
//! parameters of an infinite curve setting active.
|
//! 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().
|
//! Resets HasOwnMaximalParameterValue() flag, e.g. undoes SetMaximalParameterValue().
|
||||||
void UnsetOwnMaximalParameterValue()
|
void UnsetOwnMaximalParameterValue()
|
||||||
{
|
{
|
||||||
myHasOwnMaximalParameterValue = false;
|
myMaximalParameterValue = -1.0;
|
||||||
myMaximalParameterValue = 500000.0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Sets IsoOnPlane on or off by setting the parameter theIsEnabled to true or false.
|
//! 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);
|
Standard_EXPORT void SetIsoOnTriangulation (const Standard_Boolean theToEnable);
|
||||||
|
|
||||||
//! Sets the discretisation parameter theValue.
|
//! 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.
|
//! Returns the discretisation setting.
|
||||||
Standard_Integer Discretisation() const
|
Standard_Integer Discretisation() const
|
||||||
{
|
{
|
||||||
return myHasOwnNbPoints || myLink.IsNull()
|
return myNbPoints != -1
|
||||||
? myNbPoints
|
? myNbPoints
|
||||||
: myLink->Discretisation();
|
: (!myLink.IsNull()
|
||||||
|
? myLink->Discretisation()
|
||||||
|
: 30);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns true if the drawer has discretisation setting active.
|
//! 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().
|
//! Resets HasOwnDiscretisation() flag, e.g. undoes SetDiscretisation().
|
||||||
void UnsetOwnDiscretisation()
|
void UnsetOwnDiscretisation()
|
||||||
{
|
{
|
||||||
myHasOwnNbPoints = false;
|
myNbPoints = -1;
|
||||||
myNbPoints = 30;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Sets the deviation coefficient theCoefficient.
|
//! Sets the deviation coefficient theCoefficient.
|
||||||
@ -222,27 +237,28 @@ public:
|
|||||||
//! SizeOfObject * DeviationCoefficient.
|
//! SizeOfObject * DeviationCoefficient.
|
||||||
Standard_Real DeviationCoefficient() const
|
Standard_Real DeviationCoefficient() const
|
||||||
{
|
{
|
||||||
return HasOwnDeviationCoefficient() || myLink.IsNull()
|
return myDeviationCoefficient > 0.0
|
||||||
? myDeviationCoefficient
|
? myDeviationCoefficient
|
||||||
: myLink->DeviationCoefficient();
|
: (!myLink.IsNull()
|
||||||
|
? myLink->DeviationCoefficient()
|
||||||
|
: 0.001);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Resets HasOwnDeviationCoefficient() flag, e.g. undoes previous SetDeviationCoefficient().
|
//! Resets HasOwnDeviationCoefficient() flag, e.g. undoes previous SetDeviationCoefficient().
|
||||||
void SetDeviationCoefficient()
|
void SetDeviationCoefficient()
|
||||||
{
|
{
|
||||||
myHasOwnDeviationCoefficient = Standard_False;
|
myDeviationCoefficient = -1.0;
|
||||||
myDeviationCoefficient = 0.001;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns true if there is a local setting for deviation
|
//! Returns true if there is a local setting for deviation
|
||||||
//! coefficient in this framework for a specific interactive object.
|
//! 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
|
//! Saves the previous value used for the chordal
|
||||||
//! deviation coefficient.
|
//! deviation coefficient.
|
||||||
Standard_Real PreviousDeviationCoefficient() const
|
Standard_Real PreviousDeviationCoefficient() const
|
||||||
{
|
{
|
||||||
return myHasOwnDeviationCoefficient
|
return HasOwnDeviationCoefficient()
|
||||||
? myPreviousDeviationCoefficient
|
? myPreviousDeviationCoefficient
|
||||||
: 0.0;
|
: 0.0;
|
||||||
}
|
}
|
||||||
@ -250,7 +266,7 @@ public:
|
|||||||
//! Updates the previous value used for the chordal deviation coefficient to the current state.
|
//! Updates the previous value used for the chordal deviation coefficient to the current state.
|
||||||
void UpdatePreviousDeviationCoefficient()
|
void UpdatePreviousDeviationCoefficient()
|
||||||
{
|
{
|
||||||
if (myHasOwnDeviationCoefficient)
|
if (HasOwnDeviationCoefficient())
|
||||||
{
|
{
|
||||||
myPreviousDeviationCoefficient = DeviationCoefficient();
|
myPreviousDeviationCoefficient = DeviationCoefficient();
|
||||||
}
|
}
|
||||||
@ -263,26 +279,27 @@ public:
|
|||||||
//! Returns the value for deviation angle in radians, 20 * M_PI / 180 by default.
|
//! Returns the value for deviation angle in radians, 20 * M_PI / 180 by default.
|
||||||
Standard_Real DeviationAngle() const
|
Standard_Real DeviationAngle() const
|
||||||
{
|
{
|
||||||
return HasOwnDeviationAngle() || myLink.IsNull()
|
return myDeviationAngle > 0.0
|
||||||
? myDeviationAngle
|
? myDeviationAngle
|
||||||
: myLink->DeviationAngle();
|
: (!myLink.IsNull()
|
||||||
|
? myLink->DeviationAngle()
|
||||||
|
: 20.0 * M_PI / 180.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Resets HasOwnDeviationAngle() flag, e.g. undoes previous SetDeviationAngle().
|
//! Resets HasOwnDeviationAngle() flag, e.g. undoes previous SetDeviationAngle().
|
||||||
void SetDeviationAngle()
|
void SetDeviationAngle()
|
||||||
{
|
{
|
||||||
myHasOwnDeviationAngle = Standard_False;
|
myDeviationAngle = -1.0;
|
||||||
myDeviationAngle = 20.0 * M_PI / 180.0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns true if there is a local setting for deviation
|
//! Returns true if there is a local setting for deviation
|
||||||
//! angle in this framework for a specific interactive object.
|
//! 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
|
//! Returns the previous deviation angle
|
||||||
Standard_Real PreviousDeviationAngle() const
|
Standard_Real PreviousDeviationAngle() const
|
||||||
{
|
{
|
||||||
return myHasOwnDeviationAngle
|
return HasOwnDeviationAngle()
|
||||||
? myPreviousDeviationAngle
|
? myPreviousDeviationAngle
|
||||||
: 0.0;
|
: 0.0;
|
||||||
}
|
}
|
||||||
@ -290,7 +307,7 @@ public:
|
|||||||
//! Updates the previous deviation angle to the current value
|
//! Updates the previous deviation angle to the current value
|
||||||
void UpdatePreviousDeviationAngle()
|
void UpdatePreviousDeviationAngle()
|
||||||
{
|
{
|
||||||
if (myHasOwnDeviationAngle)
|
if (HasOwnDeviationAngle())
|
||||||
{
|
{
|
||||||
myPreviousDeviationAngle = DeviationAngle();
|
myPreviousDeviationAngle = DeviationAngle();
|
||||||
}
|
}
|
||||||
@ -320,64 +337,54 @@ public:
|
|||||||
myIsAutoTriangulated = true;
|
myIsAutoTriangulated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Defines the attributes which are used when drawing an
|
//! Defines own attributes for drawing an U isoparametric curve of a face,
|
||||||
//! U isoparametric curve of a face. Defines the number
|
//! settings from linked Drawer or NULL if neither was set.
|
||||||
//! 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
|
|
||||||
//!
|
//!
|
||||||
//! These attributes are used by the following algorithms:
|
//! These attributes are used by the following algorithms:
|
||||||
//! Prs3d_WFDeflectionSurface
|
//! Prs3d_WFDeflectionSurface
|
||||||
//! Prs3d_WFDeflectionRestrictedFace
|
//! 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
|
//! Returns true if the drawer has its own attribute for
|
||||||
//! UIso aspect that overrides the one in the link.
|
//! 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
|
//! Defines own attributes for drawing an V isoparametric curve of a face,
|
||||||
//! V isoparametric curve of a face. Defines the number
|
//! settings from linked Drawer or NULL if neither was set.
|
||||||
//! 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
|
|
||||||
//!
|
//!
|
||||||
//! These attributes are used by the following algorithms:
|
//! These attributes are used by the following algorithms:
|
||||||
//! Prs3d_WFDeflectionSurface
|
//! Prs3d_WFDeflectionSurface
|
||||||
//! Prs3d_WFDeflectionRestrictedFace
|
//! Prs3d_WFDeflectionRestrictedFace
|
||||||
Standard_EXPORT const Handle(Prs3d_IsoAspect)& VIsoAspect();
|
Standard_EXPORT const Handle(Prs3d_IsoAspect)& VIsoAspect() const;
|
||||||
|
|
||||||
//! Sets the appearance of V isoparameters - theAspect.
|
//! 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
|
//! Returns true if the drawer has its own attribute for
|
||||||
//! VIso aspect that overrides the one in the link.
|
//! 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.
|
//! Returns own wire aspect settings, settings from linked Drawer or NULL if neither was set.
|
||||||
//! 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
|
|
||||||
//! These attributes are used by the algorithm Prs3d_WFShape.
|
//! 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.
|
//! 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
|
//! Returns true if the drawer has its own attribute for
|
||||||
//! wire aspect that overrides the one in the link.
|
//! 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.
|
//! Sets WireDraw on or off by setting the parameter theIsEnabled to true or false.
|
||||||
Standard_EXPORT void SetWireDraw(const Standard_Boolean theIsEnabled);
|
Standard_EXPORT void SetWireDraw(const Standard_Boolean theIsEnabled);
|
||||||
@ -401,43 +408,46 @@ public:
|
|||||||
myWireDraw = true;
|
myWireDraw = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns the point aspect setting. The default values are
|
//! Returns own point aspect setting, settings from linked Drawer or NULL if neither was set.
|
||||||
//! Color: Quantity_NOC_YELLOW
|
|
||||||
//! Type of marker: Aspect_TOM_PLUS
|
|
||||||
//! Scale: 1.0
|
|
||||||
//! These attributes are used by the algorithms Prs3d_Point.
|
//! 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
|
//! 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
|
//! Returns true if the drawer has its own attribute for
|
||||||
//! point aspect that overrides the one in the link.
|
//! 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.
|
//! 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)());
|
Standard_EXPORT Standard_Boolean SetupOwnPointAspect (const Handle(Prs3d_Drawer)& theDefaults = Handle(Prs3d_Drawer)());
|
||||||
|
|
||||||
//! Returns settings for line aspects.
|
//! Returns own settings for line aspects, settings from linked Drawer or NULL if neither was set.
|
||||||
//! These settings can be edited. The default values are:
|
|
||||||
//! Color: Quantity_NOC_YELLOW
|
|
||||||
//! Type of line: Aspect_TOL_SOLID
|
|
||||||
//! Width: 1.0
|
|
||||||
//! These attributes are used by the following algorithms:
|
//! These attributes are used by the following algorithms:
|
||||||
//! Prs3d_Curve
|
//! Prs3d_Curve
|
||||||
//! Prs3d_Line
|
//! Prs3d_Line
|
||||||
//! Prs3d_HLRShape
|
//! 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.
|
//! 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
|
//! Returns true if the drawer has its own attribute for
|
||||||
//! line aspect that overrides the one in the link.
|
//! 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.
|
//! Returns FALSE if own line aspect are already set.
|
||||||
Standard_EXPORT Standard_Boolean SetOwnLineAspects (const Handle(Prs3d_Drawer)& theDefaults = Handle(Prs3d_Drawer)());
|
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.
|
//! Returns FALSE if own line for datums are already set.
|
||||||
Standard_EXPORT Standard_Boolean SetOwnDatumAspects (const Handle(Prs3d_Drawer)& theDefaults = Handle(Prs3d_Drawer)());
|
Standard_EXPORT Standard_Boolean SetOwnDatumAspects (const Handle(Prs3d_Drawer)& theDefaults = Handle(Prs3d_Drawer)());
|
||||||
|
|
||||||
//! Returns settings for text aspect.
|
//! Returns own settings for text aspect, settings from linked Drawer or NULL if neither was set.
|
||||||
//! These settings can be edited. The default value is:
|
Standard_EXPORT const Handle(Prs3d_TextAspect)& TextAspect() const;
|
||||||
//! - Color: Quantity_NOC_YELLOW
|
|
||||||
Standard_EXPORT const Handle(Prs3d_TextAspect)& TextAspect();
|
|
||||||
|
|
||||||
//! Sets the parameter theAspect for display attributes of text.
|
//! 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
|
//! Returns true if the drawer has its own attribute for
|
||||||
//! text aspect that overrides the one in the link.
|
//! 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.
|
//! Returns own settings for shading aspects, settings from linked Drawer or NULL if neither was set.
|
||||||
//! These settings can be edited. The default values are:
|
Standard_EXPORT const Handle(Prs3d_ShadingAspect)& ShadingAspect() const;
|
||||||
//! - 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();
|
|
||||||
|
|
||||||
//! Sets the parameter theAspect for display attributes of shading.
|
//! 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
|
//! Returns true if the drawer has its own attribute for
|
||||||
//! shading aspect that overrides the one in the link.
|
//! 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.
|
//! 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)());
|
Standard_EXPORT Standard_Boolean SetupOwnShadingAspect (const Handle(Prs3d_Drawer)& theDefaults = Handle(Prs3d_Drawer)());
|
||||||
|
|
||||||
//! Returns settings for seen line aspects.
|
//! Returns own settings for seen line aspects, settings of linked Drawer or NULL if neither was set.
|
||||||
//! These settings can be edited. The default values are:
|
Standard_EXPORT const Handle(Prs3d_LineAspect)& SeenLineAspect() const;
|
||||||
//! Color: Quantity_NOC_YELLOW
|
|
||||||
//! Type of line: Aspect_TOL_SOLID
|
|
||||||
//! Width: 1.0
|
|
||||||
Standard_EXPORT const Handle(Prs3d_LineAspect)& SeenLineAspect();
|
|
||||||
|
|
||||||
//! Sets the parameter theAspect for the display of seen lines in hidden line removal mode.
|
//! 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
|
//! Returns true if the drawer has its own attribute for
|
||||||
//! seen line aspect that overrides the one in the link.
|
//! 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.
|
//! 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();
|
Standard_EXPORT const Handle(Prs3d_PlaneAspect)& PlaneAspect() const;
|
||||||
|
|
||||||
//! Sets the parameter theAspect for the display of planes.
|
//! 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
|
//! Returns true if the drawer has its own attribute for
|
||||||
//! plane aspect that overrides the one in the link.
|
//! 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.
|
//! Returns own attributes for display of arrows, settings from linked Drawer or NULL if neither was set.
|
||||||
Standard_EXPORT const Handle(Prs3d_ArrowAspect)& ArrowAspect();
|
Standard_EXPORT const Handle(Prs3d_ArrowAspect)& ArrowAspect() const;
|
||||||
|
|
||||||
//! Sets the parameter theAspect for display attributes of arrows.
|
//! 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
|
//! Returns true if the drawer has its own attribute for
|
||||||
//! arrow aspect that overrides the one in the link.
|
//! 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.
|
//! Enables the drawing of an arrow at the end of each line.
|
||||||
//! By default the arrows are not drawn.
|
//! By default the arrows are not drawn.
|
||||||
@ -537,19 +548,18 @@ public:
|
|||||||
myLineArrowDraw = false;
|
myLineArrowDraw = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns settings for hidden line aspects.
|
//! Returns own settings for hidden line aspects, settings from linked Drawer or NULL if neither was set.
|
||||||
//! These settings can be edited. The default values are:
|
Standard_EXPORT const Handle(Prs3d_LineAspect)& HiddenLineAspect() const;
|
||||||
//! Color: Quantity_NOC_YELLOW
|
|
||||||
//! Type of line: Aspect_TOL_DASH
|
|
||||||
//! Width: 1.0
|
|
||||||
Standard_EXPORT const Handle(Prs3d_LineAspect)& HiddenLineAspect();
|
|
||||||
|
|
||||||
//! Sets the parameter theAspect for the display of hidden lines in hidden line removal mode.
|
//! 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
|
//! Returns true if the drawer has its own attribute for
|
||||||
//! hidden lines aspect that overrides the one in the link.
|
//! 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.
|
//! Returns Standard_True if the hidden lines are to be drawn.
|
||||||
//! By default the hidden lines are not drawn.
|
//! By default the hidden lines are not drawn.
|
||||||
@ -577,19 +587,18 @@ public:
|
|||||||
myDrawHiddenLine = false;
|
myDrawHiddenLine = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns settings for the appearance of vectors.
|
//! Returns own settings for the appearance of vectors, settings from linked Drawer or NULL if neither was set.
|
||||||
//! These settings can be edited. The default values are:
|
Standard_EXPORT const Handle(Prs3d_LineAspect)& VectorAspect() const;
|
||||||
//! Color: Quantity_NOC_SKYBLUE
|
|
||||||
//! Type of line: Aspect_TOL_SOLID
|
|
||||||
//! Width: 1.0
|
|
||||||
Standard_EXPORT const Handle(Prs3d_LineAspect)& VectorAspect();
|
|
||||||
|
|
||||||
//! Sets the modality theAspect for the display of vectors.
|
//! 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
|
//! Returns true if the drawer has its own attribute for
|
||||||
//! vector aspect that overrides the one in the link.
|
//! 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.
|
//! 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,
|
//! 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);
|
Standard_EXPORT void SetVertexDrawMode (const Prs3d_VertexDrawMode theMode);
|
||||||
|
|
||||||
//! Returns the current mode of visualization of vertices of a TopoDS_Shape instance.
|
//! 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>.
|
//! 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
|
//! This means that individual vertex draw mode value (i.e. not inherited from the global
|
||||||
//! drawer) is used for a specific interactive object.
|
//! drawer) is used for a specific interactive object.
|
||||||
Standard_Boolean HasOwnVertexDrawMode() const { return (myVertexDrawMode != Prs3d_VDM_Inherited); }
|
Standard_Boolean HasOwnVertexDrawMode() const { return (myVertexDrawMode != Prs3d_VDM_Inherited); }
|
||||||
|
|
||||||
//! Returns settings for the appearance of datums.
|
//! Returns own settings for the appearance of datums, settings from linked Drawer or NULL if neither was set.
|
||||||
//! These settings can be edited. The default values for the three axes are:
|
Standard_EXPORT const Handle(Prs3d_DatumAspect)& DatumAspect() const;
|
||||||
//! Color: Quantity_NOC_PEACHPUFF
|
|
||||||
//! Type of line: Aspect_TOL_SOLID
|
|
||||||
//! Width: 1.0
|
|
||||||
Standard_EXPORT const Handle(Prs3d_DatumAspect)& DatumAspect();
|
|
||||||
|
|
||||||
//! Sets the modality theAspect for the display of datums.
|
//! 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
|
//! Returns true if the drawer has its own attribute for
|
||||||
//! datum aspect that overrides the one in the link.
|
//! 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.
|
//! Returns own LineAspect for section wire, settings from linked Drawer or NULL if neither was set.
|
||||||
//! The default values are:
|
|
||||||
//! Color: Quantity_NOC_ORANGE
|
|
||||||
//! Type of line: Aspect_TOL_SOLID
|
|
||||||
//! Width: 1.0
|
|
||||||
//! These attributes are used by the algorithm Prs3d_WFShape.
|
//! 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.
|
//! 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
|
//! Returns true if the drawer has its own attribute for
|
||||||
//! section aspect that overrides the one in the link.
|
//! 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.
|
//! Sets the parameter theAspect for the display of free boundaries.
|
||||||
//! The method sets aspect owned by the drawer that will be used during
|
//! The method sets aspect owned by the drawer that will be used during
|
||||||
//! visualization instead of the one set in link.
|
//! 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,
|
//! Returns own settings for presentation of free boundaries, settings from linked Drawer or NULL if neither was set.
|
||||||
//! in other words, boundaries which are not shared.
|
//! In other words, this settings affect 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
|
|
||||||
//! These attributes are used by the algorithm Prs3d_WFShape
|
//! 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
|
//! Returns true if the drawer has its own attribute for
|
||||||
//! free boundaries aspect that overrides the one in the link.
|
//! 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.
|
//! Enables or disables drawing of free boundaries for shading presentations.
|
||||||
//! The method sets drawing flag owned by the drawer that will be used during
|
//! 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.
|
//! Sets the parameter theAspect for the display of shared boundaries.
|
||||||
//! The method sets aspect owned by the drawer that will be used during
|
//! The method sets aspect owned by the drawer that will be used during
|
||||||
//! visualization instead of the one set in link.
|
//! 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.
|
//! Returns own settings for shared boundary line aspects, settings from linked Drawer or NULL if neither was set.
|
||||||
//! 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.
|
|
||||||
//! These attributes are used by the algorithm Prs3d_WFShape
|
//! 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
|
//! Returns true if the drawer has its own attribute for
|
||||||
//! unfree boundaries aspect that overrides the one in the link.
|
//! 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.
|
//! Enables or disables drawing of shared boundaries for shading presentations.
|
||||||
//! The method sets drawing flag owned by the drawer that will be used during
|
//! 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
|
//! The method sets line aspect owned by the drawer that will be used during
|
||||||
//! visualization instead of the one set in link.
|
//! visualization instead of the one set in link.
|
||||||
//! theAspect is the line aspect that determines the look of the face boundaries.
|
//! 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.
|
//! Returns own line aspect of face boundaries, settings from linked Drawer or NULL if neither was set.
|
||||||
Standard_EXPORT const Handle(Prs3d_LineAspect)& FaceBoundaryAspect();
|
Standard_EXPORT const Handle(Prs3d_LineAspect)& FaceBoundaryAspect() const;
|
||||||
|
|
||||||
//! Returns true if the drawer has its own attribute for
|
//! Returns true if the drawer has its own attribute for
|
||||||
//! face boundaries aspect that overrides the one in the link.
|
//! 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.
|
//! 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)());
|
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.
|
//! Unset the most edge continuity class for face boundaries.
|
||||||
void UnsetFaceBoundaryUpperContinuity() { myFaceBoundaryUpperContinuity = -1; }
|
void UnsetFaceBoundaryUpperContinuity() { myFaceBoundaryUpperContinuity = -1; }
|
||||||
|
|
||||||
//! Returns settings for the appearance of dimensions.
|
//! 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();
|
Standard_EXPORT const Handle(Prs3d_DimensionAspect)& DimensionAspect() const;
|
||||||
|
|
||||||
//! Sets the settings for the appearance of dimensions.
|
//! Sets the settings for the appearance of dimensions.
|
||||||
//! The method sets aspect owned by the drawer that will be used during
|
//! The method sets aspect owned by the drawer that will be used during
|
||||||
//! visualization instead of the one set in link.
|
//! 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
|
//! Returns true if the drawer has its own attribute for
|
||||||
//! the appearance of dimensions that overrides the one in the link.
|
//! 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.
|
//! Sets dimension length model units for computing of dimension presentation.
|
||||||
//! The method sets value owned by the drawer that will be used during
|
//! The method sets value owned by the drawer that will be used during
|
||||||
@ -900,7 +909,7 @@ public:
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
//! Returns the drawer to which the current object references.
|
//! 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.
|
//! Returns true if the current object has a link on the other drawer.
|
||||||
Standard_Boolean HasLink() const { return !myLink.IsNull(); }
|
Standard_Boolean HasLink() const { return !myLink.IsNull(); }
|
||||||
@ -953,19 +962,14 @@ protected:
|
|||||||
Handle(Prs3d_Drawer) myLink;
|
Handle(Prs3d_Drawer) myLink;
|
||||||
|
|
||||||
Standard_Integer myNbPoints;
|
Standard_Integer myNbPoints;
|
||||||
Standard_Boolean myHasOwnNbPoints;
|
|
||||||
Standard_Real myMaximalParameterValue;
|
Standard_Real myMaximalParameterValue;
|
||||||
Standard_Boolean myHasOwnMaximalParameterValue;
|
|
||||||
Standard_Real myChordialDeviation;
|
Standard_Real myChordialDeviation;
|
||||||
Standard_Boolean myHasOwnChordialDeviation;
|
|
||||||
Aspect_TypeOfDeflection myTypeOfDeflection;
|
Aspect_TypeOfDeflection myTypeOfDeflection;
|
||||||
Standard_Boolean myHasOwnTypeOfDeflection;
|
Standard_Boolean myHasOwnTypeOfDeflection;
|
||||||
Prs3d_TypeOfHLR myTypeOfHLR;
|
Prs3d_TypeOfHLR myTypeOfHLR;
|
||||||
Standard_Real myDeviationCoefficient;
|
Standard_Real myDeviationCoefficient;
|
||||||
Standard_Real myPreviousDeviationCoefficient;
|
Standard_Real myPreviousDeviationCoefficient;
|
||||||
Standard_Boolean myHasOwnDeviationCoefficient;
|
|
||||||
Standard_Real myDeviationAngle;
|
Standard_Real myDeviationAngle;
|
||||||
Standard_Boolean myHasOwnDeviationAngle;
|
|
||||||
Standard_Real myPreviousDeviationAngle;
|
Standard_Real myPreviousDeviationAngle;
|
||||||
Standard_Boolean myIsoOnPlane;
|
Standard_Boolean myIsoOnPlane;
|
||||||
Standard_Boolean myHasOwnIsoOnPlane;
|
Standard_Boolean myHasOwnIsoOnPlane;
|
||||||
@ -975,57 +979,39 @@ protected:
|
|||||||
Standard_Boolean myHasOwnIsAutoTriangulated;
|
Standard_Boolean myHasOwnIsAutoTriangulated;
|
||||||
|
|
||||||
Handle(Prs3d_IsoAspect) myUIsoAspect;
|
Handle(Prs3d_IsoAspect) myUIsoAspect;
|
||||||
Standard_Boolean myHasOwnUIsoAspect;
|
|
||||||
Handle(Prs3d_IsoAspect) myVIsoAspect;
|
Handle(Prs3d_IsoAspect) myVIsoAspect;
|
||||||
Standard_Boolean myHasOwnVIsoAspect;
|
|
||||||
Handle(Prs3d_LineAspect) myWireAspect;
|
Handle(Prs3d_LineAspect) myWireAspect;
|
||||||
Standard_Boolean myHasOwnWireAspect;
|
|
||||||
Standard_Boolean myWireDraw;
|
Standard_Boolean myWireDraw;
|
||||||
Standard_Boolean myHasOwnWireDraw;
|
Standard_Boolean myHasOwnWireDraw;
|
||||||
Handle(Prs3d_PointAspect) myPointAspect;
|
Handle(Prs3d_PointAspect) myPointAspect;
|
||||||
Standard_Boolean myHasOwnPointAspect;
|
|
||||||
Handle(Prs3d_LineAspect) myLineAspect;
|
Handle(Prs3d_LineAspect) myLineAspect;
|
||||||
Standard_Boolean myHasOwnLineAspect;
|
|
||||||
Handle(Prs3d_TextAspect) myTextAspect;
|
Handle(Prs3d_TextAspect) myTextAspect;
|
||||||
Standard_Boolean myHasOwnTextAspect;
|
|
||||||
Handle(Prs3d_ShadingAspect) myShadingAspect;
|
Handle(Prs3d_ShadingAspect) myShadingAspect;
|
||||||
Standard_Boolean myHasOwnShadingAspect;
|
|
||||||
Handle(Prs3d_PlaneAspect) myPlaneAspect;
|
Handle(Prs3d_PlaneAspect) myPlaneAspect;
|
||||||
Standard_Boolean myHasOwnPlaneAspect;
|
|
||||||
Handle(Prs3d_LineAspect) mySeenLineAspect;
|
Handle(Prs3d_LineAspect) mySeenLineAspect;
|
||||||
Standard_Boolean myHasOwnSeenLineAspect;
|
|
||||||
Handle(Prs3d_ArrowAspect) myArrowAspect;
|
Handle(Prs3d_ArrowAspect) myArrowAspect;
|
||||||
Standard_Boolean myHasOwnArrowAspect;
|
|
||||||
Standard_Boolean myLineArrowDraw;
|
Standard_Boolean myLineArrowDraw;
|
||||||
Standard_Boolean myHasOwnLineArrowDraw;
|
Standard_Boolean myHasOwnLineArrowDraw;
|
||||||
Handle(Prs3d_LineAspect) myHiddenLineAspect;
|
Handle(Prs3d_LineAspect) myHiddenLineAspect;
|
||||||
Standard_Boolean myHasOwnHiddenLineAspect;
|
|
||||||
Standard_Boolean myDrawHiddenLine;
|
Standard_Boolean myDrawHiddenLine;
|
||||||
Standard_Boolean myHasOwnDrawHiddenLine;
|
Standard_Boolean myHasOwnDrawHiddenLine;
|
||||||
Handle(Prs3d_LineAspect) myVectorAspect;
|
Handle(Prs3d_LineAspect) myVectorAspect;
|
||||||
Standard_Boolean myHasOwnVectorAspect;
|
|
||||||
Prs3d_VertexDrawMode myVertexDrawMode;
|
Prs3d_VertexDrawMode myVertexDrawMode;
|
||||||
Handle(Prs3d_DatumAspect) myDatumAspect;
|
Handle(Prs3d_DatumAspect) myDatumAspect;
|
||||||
Standard_Boolean myHasOwnDatumAspect;
|
|
||||||
Handle(Prs3d_LineAspect) mySectionAspect;
|
Handle(Prs3d_LineAspect) mySectionAspect;
|
||||||
Standard_Boolean myHasOwnSectionAspect;
|
|
||||||
|
|
||||||
Handle(Prs3d_LineAspect) myFreeBoundaryAspect;
|
Handle(Prs3d_LineAspect) myFreeBoundaryAspect;
|
||||||
Standard_Boolean myHasOwnFreeBoundaryAspect;
|
|
||||||
Standard_Boolean myFreeBoundaryDraw;
|
Standard_Boolean myFreeBoundaryDraw;
|
||||||
Standard_Boolean myHasOwnFreeBoundaryDraw;
|
Standard_Boolean myHasOwnFreeBoundaryDraw;
|
||||||
Handle(Prs3d_LineAspect) myUnFreeBoundaryAspect;
|
Handle(Prs3d_LineAspect) myUnFreeBoundaryAspect;
|
||||||
Standard_Boolean myHasOwnUnFreeBoundaryAspect;
|
|
||||||
Standard_Boolean myUnFreeBoundaryDraw;
|
Standard_Boolean myUnFreeBoundaryDraw;
|
||||||
Standard_Boolean myHasOwnUnFreeBoundaryDraw;
|
Standard_Boolean myHasOwnUnFreeBoundaryDraw;
|
||||||
Handle(Prs3d_LineAspect) myFaceBoundaryAspect;
|
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_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 myFaceBoundaryDraw;
|
||||||
Standard_Boolean myHasOwnFaceBoundaryDraw;
|
Standard_Boolean myHasOwnFaceBoundaryDraw;
|
||||||
|
|
||||||
Handle(Prs3d_DimensionAspect) myDimensionAspect;
|
Handle(Prs3d_DimensionAspect) myDimensionAspect;
|
||||||
Standard_Boolean myHasOwnDimensionAspect;
|
|
||||||
Prs3d_DimensionUnits myDimensionModelUnits;
|
Prs3d_DimensionUnits myDimensionModelUnits;
|
||||||
Standard_Boolean myHasOwnDimLengthModelUnits;
|
Standard_Boolean myHasOwnDimLengthModelUnits;
|
||||||
Standard_Boolean myHasOwnDimAngleModelUnits;
|
Standard_Boolean myHasOwnDimAngleModelUnits;
|
||||||
|
@ -1033,117 +1033,6 @@ static Standard_Integer OCC884 (Draw_Interpretor& di, Standard_Integer argc, con
|
|||||||
return 0;
|
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 <TopoDS_Solid.hxx>
|
||||||
#include <BRepFeat_MakeDPrism.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 ("OCC814", "OCC814", __FILE__, OCC814, group);
|
||||||
theCommands.Add ("OCC884", "OCC884 result shape [toler [maxtoler]]", __FILE__, OCC884, 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 ("OCCN1", "OCCN1 angle fuse(1 for boss / 0 for slot) length", __FILE__, OCCN1, group);
|
||||||
theCommands.Add ("OCCN2", "OCCN2", __FILE__, OCCN2, group);
|
theCommands.Add ("OCCN2", "OCCN2", __FILE__, OCCN2, group);
|
||||||
|
|
||||||
|
@ -5026,7 +5026,7 @@ static Standard_Integer VTriangle (Draw_Interpretor& /*di*/,
|
|||||||
if (!isTri)
|
if (!isTri)
|
||||||
{
|
{
|
||||||
aPrs->Attributes()->SetupOwnShadingAspect();
|
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);
|
ViewerTest::Display (argv[1], aPrs);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -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
|
|
Loading…
x
Reference in New Issue
Block a user