// purpose :
// =======================================================================
Prs3d_Drawer::Prs3d_Drawer()
-: myNbPoints (30),
- myHasOwnNbPoints (Standard_False),
- myMaximalParameterValue (500000.),
- myHasOwnMaximalParameterValue (Standard_False),
- myChordialDeviation (0.0001),
- myHasOwnChordialDeviation (Standard_False),
+: myNbPoints (-1),
+ myMaximalParameterValue (-1.0),
+ myChordialDeviation (-1.0),
myTypeOfDeflection (Aspect_TOD_RELATIVE),
myHasOwnTypeOfDeflection (Standard_False),
myTypeOfHLR (Prs3d_TOH_NotSet),
- myDeviationCoefficient (0.001),
- myHasOwnDeviationCoefficient (Standard_False),
- myDeviationAngle (20.0 * M_PI / 180.0),
- myHasOwnDeviationAngle (Standard_False),
+ myDeviationCoefficient (-1.0),
+ myDeviationAngle (-1.0),
myIsoOnPlane (Standard_False),
myHasOwnIsoOnPlane (Standard_False),
myIsoOnTriangulation (Standard_False),
myIsAutoTriangulated (Standard_True),
myHasOwnIsAutoTriangulated (Standard_False),
- myHasOwnUIsoAspect (Standard_False),
- myHasOwnVIsoAspect (Standard_False),
- myHasOwnWireAspect (Standard_False),
myWireDraw (Standard_True),
myHasOwnWireDraw (Standard_False),
- myHasOwnPointAspect (Standard_False),
- myHasOwnLineAspect (Standard_False),
- myHasOwnTextAspect (Standard_False),
- myHasOwnShadingAspect (Standard_False),
- myHasOwnPlaneAspect (Standard_False),
- myHasOwnSeenLineAspect (Standard_False),
- myHasOwnArrowAspect (Standard_False),
myLineArrowDraw (Standard_False),
myHasOwnLineArrowDraw (Standard_False),
- myHasOwnHiddenLineAspect (Standard_False),
myDrawHiddenLine (Standard_False),
myHasOwnDrawHiddenLine (Standard_False),
- myHasOwnVectorAspect (Standard_False),
myVertexDrawMode (Prs3d_VDM_Inherited),
- myHasOwnDatumAspect (Standard_False),
- myHasOwnSectionAspect (Standard_False),
- myHasOwnFreeBoundaryAspect (Standard_False),
myFreeBoundaryDraw (Standard_True),
myHasOwnFreeBoundaryDraw (Standard_False),
- myHasOwnUnFreeBoundaryAspect (Standard_False),
myUnFreeBoundaryDraw (Standard_True),
myHasOwnUnFreeBoundaryDraw (Standard_False),
myFaceBoundaryUpperContinuity(-1),
- myHasOwnFaceBoundaryAspect (Standard_False),
myFaceBoundaryDraw (Standard_False),
myHasOwnFaceBoundaryDraw (Standard_False),
- myHasOwnDimensionAspect (Standard_False),
myHasOwnDimLengthModelUnits (Standard_False),
myHasOwnDimAngleModelUnits (Standard_False),
myHasOwnDimLengthDisplayUnits (Standard_False),
}
// =======================================================================
-// function : SetTypeOfDeflection
+// function : SetupOwnDefaults
// purpose :
// =======================================================================
-
-void Prs3d_Drawer::SetTypeOfDeflection (const Aspect_TypeOfDeflection theTypeOfDeflection)
+void Prs3d_Drawer::SetupOwnDefaults()
{
- myHasOwnTypeOfDeflection = Standard_True;
- myTypeOfDeflection = theTypeOfDeflection;
+ myNbPoints = 30;
+ myMaximalParameterValue = 500000.0;
+ myChordialDeviation = 0.0001;
+ myDeviationCoefficient = 0.001;
+ myDeviationAngle = 20.0 * M_PI / 180.0;
+ SetupOwnShadingAspect();
+ SetupOwnPointAspect();
+ SetOwnDatumAspects();
+ SetOwnLineAspects();
+ SetTextAspect (new Prs3d_TextAspect());
+ SetDimensionAspect (new Prs3d_DimensionAspect());
}
// =======================================================================
-// function : SetMaximalChordialDeviation
+// function : SetTypeOfDeflection
// purpose :
// =======================================================================
-void Prs3d_Drawer::SetMaximalChordialDeviation (const Standard_Real theChordialDeviation)
+void Prs3d_Drawer::SetTypeOfDeflection (const Aspect_TypeOfDeflection theTypeOfDeflection)
{
- myHasOwnChordialDeviation = Standard_True;
- myChordialDeviation = theChordialDeviation;
+ myHasOwnTypeOfDeflection = Standard_True;
+ myTypeOfDeflection = theTypeOfDeflection;
}
// =======================================================================
// purpose : gets type of HLR algorithm
// =======================================================================
-Prs3d_TypeOfHLR Prs3d_Drawer::TypeOfHLR()
+Prs3d_TypeOfHLR Prs3d_Drawer::TypeOfHLR() const
{
- if (!HasOwnTypeOfHLR())
+ if (HasOwnTypeOfHLR())
{
- if (!myLink.IsNull())
- {
- return myLink->TypeOfHLR();
- }
- // Prs3d_TOH_PolyAlgo is default value for this setting.
- myTypeOfHLR = Prs3d_TOH_PolyAlgo;
+ return myTypeOfHLR;
+ }
+ else if (!myLink.IsNull())
+ {
+ return myLink->TypeOfHLR();
}
- return myTypeOfHLR;
+ return Prs3d_TOH_PolyAlgo;
}
// =======================================================================
myIsoOnTriangulation = theToEnable;
}
-// =======================================================================
-// function : SetMaximalParameterValue
-// purpose :
-// =======================================================================
-
-void Prs3d_Drawer::SetMaximalParameterValue (const Standard_Real theValue)
-{
- myHasOwnMaximalParameterValue = Standard_True;
- myMaximalParameterValue = theValue;
-}
-
// =======================================================================
// function : SetIsoOnPlane
// purpose :
myIsoOnPlane = theIsEnabled;
}
-// =======================================================================
-// function : SetDiscretisation
-// purpose :
-// =======================================================================
-
-void Prs3d_Drawer::SetDiscretisation (const Standard_Integer theValue)
-{
- myHasOwnNbPoints = Standard_True;
- myNbPoints = theValue;
-}
-
//=======================================================================
//function : SetDeviationCoefficient
//purpose :
{
myPreviousDeviationCoefficient = DeviationCoefficient();
myDeviationCoefficient = theCoefficient;
- myHasOwnDeviationCoefficient = Standard_True;
}
//=======================================================================
{
myPreviousDeviationAngle = DeviationAngle();
myDeviationAngle = theAngle;
- myHasOwnDeviationAngle = Standard_True;
}
// =======================================================================
// purpose :
// =======================================================================
-const Handle(Prs3d_LineAspect)& Prs3d_Drawer::FreeBoundaryAspect()
+const Handle(Prs3d_LineAspect)& Prs3d_Drawer::FreeBoundaryAspect() const
{
- if (!HasOwnFreeBoundaryAspect())
+ if (myFreeBoundaryAspect.IsNull()
+ && !myLink.IsNull())
{
- if (!myLink.IsNull())
- {
- return myLink->FreeBoundaryAspect();
- }
- if (myFreeBoundaryAspect.IsNull())
- {
- myFreeBoundaryAspect = new Prs3d_LineAspect (THE_DEF_COLOR_FreeBoundary, Aspect_TOL_SOLID, 1.0);
- }
+ return myLink->FreeBoundaryAspect();
}
return myFreeBoundaryAspect;
}
-// =======================================================================
-// function : FreeBoundaryAspect
-// purpose :
-// =======================================================================
-
-void Prs3d_Drawer::SetFreeBoundaryAspect (const Handle(Prs3d_LineAspect)& theAspect)
-{
- myFreeBoundaryAspect = theAspect;
- myHasOwnFreeBoundaryAspect = !myFreeBoundaryAspect.IsNull();
-}
-
// =======================================================================
// function : SetFreeBoundaryDraw
// purpose :
// purpose :
// =======================================================================
-const Handle(Prs3d_LineAspect)& Prs3d_Drawer::UnFreeBoundaryAspect()
+const Handle(Prs3d_LineAspect)& Prs3d_Drawer::UnFreeBoundaryAspect() const
{
- if (!HasOwnUnFreeBoundaryAspect())
+ if (myUnFreeBoundaryAspect.IsNull()
+ && !myLink.IsNull())
{
- if (!myLink.IsNull())
- {
- return myLink->UnFreeBoundaryAspect();
- }
- if (myUnFreeBoundaryAspect.IsNull())
- {
- myUnFreeBoundaryAspect = new Prs3d_LineAspect (THE_DEF_COLOR_UnFreeBoundary, Aspect_TOL_SOLID, 1.0);
- }
+ return myLink->UnFreeBoundaryAspect();
}
return myUnFreeBoundaryAspect;
}
-// =======================================================================
-// function : SetUnFreeBoundaryAspect
-// purpose :
-// =======================================================================
-
-void Prs3d_Drawer::SetUnFreeBoundaryAspect (const Handle(Prs3d_LineAspect)& theAspect)
-{
- myUnFreeBoundaryAspect = theAspect;
- myHasOwnUnFreeBoundaryAspect = !myUnFreeBoundaryAspect.IsNull();
-}
-
// =======================================================================
// function : SetUnFreeBoundaryDraw
// purpose :
// purpose :
// =======================================================================
-const Handle(Prs3d_LineAspect)& Prs3d_Drawer::FaceBoundaryAspect()
+const Handle(Prs3d_LineAspect)& Prs3d_Drawer::FaceBoundaryAspect() const
{
- if (!HasOwnFaceBoundaryAspect())
+ if (myFaceBoundaryAspect.IsNull()
+ && !myLink.IsNull())
{
- if (!myLink.IsNull())
- {
- return myLink->FaceBoundaryAspect();
- }
- if (myFaceBoundaryAspect.IsNull())
- {
- myFaceBoundaryAspect = new Prs3d_LineAspect (THE_DEF_COLOR_FaceBoundary, Aspect_TOL_SOLID, 1.0);
- }
+ return myLink->FaceBoundaryAspect();
}
return myFaceBoundaryAspect;
}
-// =======================================================================
-// function : SetFaceBoundaryAspect
-// purpose :
-// =======================================================================
-
-void Prs3d_Drawer::SetFaceBoundaryAspect (const Handle(Prs3d_LineAspect)& theAspect)
-{
- myFaceBoundaryAspect = theAspect;
- myHasOwnFaceBoundaryAspect = !myFaceBoundaryAspect.IsNull();
-}
-
// =======================================================================
// function : SetFaceBoundaryDraw
// purpose :
// purpose :
// =======================================================================
-const Handle(Prs3d_DimensionAspect)& Prs3d_Drawer::DimensionAspect()
+const Handle(Prs3d_DimensionAspect)& Prs3d_Drawer::DimensionAspect() const
{
- if (!HasOwnDimensionAspect())
+ if (myDimensionAspect.IsNull()
+ && !myLink.IsNull())
{
- if (!myLink.IsNull())
- {
- return myLink->DimensionAspect();
- }
- if (myDimensionAspect.IsNull())
- {
- myDimensionAspect = new Prs3d_DimensionAspect;
- }
+ return myLink->DimensionAspect();
}
return myDimensionAspect;
}
-// =======================================================================
-// function : SetDimensionAspect
-// purpose :
-// =======================================================================
-
-void Prs3d_Drawer::SetDimensionAspect (const Handle(Prs3d_DimensionAspect)& theAspect)
-{
- myDimensionAspect = theAspect;
- myHasOwnDimensionAspect = !myDimensionAspect.IsNull();
-}
-
// =======================================================================
// function : SetDimLengthModelUnits
// purpose :
// purpose :
// =======================================================================
-const Handle(Prs3d_IsoAspect)& Prs3d_Drawer::UIsoAspect()
+const Handle(Prs3d_IsoAspect)& Prs3d_Drawer::UIsoAspect() const
{
- if (!HasOwnUIsoAspect())
+ if (myUIsoAspect.IsNull()
+ && !myLink.IsNull())
{
- if (!myLink.IsNull())
- {
- return myLink->UIsoAspect();
- }
- if (myUIsoAspect.IsNull())
- {
- myUIsoAspect = new Prs3d_IsoAspect (Quantity_NOC_GRAY75, Aspect_TOL_SOLID, 1.0, 1);
- }
+ return myLink->UIsoAspect();
}
return myUIsoAspect;
}
-// =======================================================================
-// function : SetUIsoAspect
-// purpose :
-// =======================================================================
-
-void Prs3d_Drawer::SetUIsoAspect (const Handle(Prs3d_IsoAspect)& theAspect)
-{
- myUIsoAspect = theAspect;
- myHasOwnUIsoAspect = !myUIsoAspect.IsNull();
-}
-
// =======================================================================
// function : VIsoAspect
// purpose :
// =======================================================================
-const Handle(Prs3d_IsoAspect)& Prs3d_Drawer::VIsoAspect()
+const Handle(Prs3d_IsoAspect)& Prs3d_Drawer::VIsoAspect() const
{
- if (!HasOwnVIsoAspect())
+ if (myVIsoAspect.IsNull()
+ && !myLink.IsNull())
{
- if (!myLink.IsNull())
- {
- return myLink->VIsoAspect();
- }
- if (myVIsoAspect.IsNull())
- {
- myVIsoAspect = new Prs3d_IsoAspect (Quantity_NOC_GRAY75, Aspect_TOL_SOLID, 1.0, 1);
- }
+ return myLink->VIsoAspect();
}
return myVIsoAspect;
}
-// =======================================================================
-// function : SetVIsoAspect
-// purpose :
-// =======================================================================
-
-void Prs3d_Drawer::SetVIsoAspect (const Handle(Prs3d_IsoAspect)& theAspect)
-{
- myVIsoAspect = theAspect;
- myHasOwnVIsoAspect= !myVIsoAspect.IsNull();
-}
-
// =======================================================================
// function : WireAspect
// purpose :
// =======================================================================
-const Handle(Prs3d_LineAspect)& Prs3d_Drawer::WireAspect()
+const Handle(Prs3d_LineAspect)& Prs3d_Drawer::WireAspect() const
{
- if (!HasOwnWireAspect())
+ if (myWireAspect.IsNull()
+ && !myLink.IsNull())
{
- if (!myLink.IsNull())
- {
- return myLink->WireAspect();
- }
- if (myWireAspect.IsNull())
- {
- myWireAspect = new Prs3d_LineAspect (THE_DEF_COLOR_Wire, Aspect_TOL_SOLID, 1.0);
- }
+ return myLink->WireAspect();
}
return myWireAspect;
}
-// =======================================================================
-// function : SetWireAspect
-// purpose :
-// =======================================================================
-
-void Prs3d_Drawer::SetWireAspect (const Handle(Prs3d_LineAspect)& theAspect)
-{
- myWireAspect = theAspect;
- myHasOwnWireAspect = !myWireAspect.IsNull();
-}
-
// =======================================================================
// function : SetWireDraw
// purpose :
// purpose :
// =======================================================================
-const Handle(Prs3d_PointAspect)& Prs3d_Drawer::PointAspect()
+const Handle(Prs3d_PointAspect)& Prs3d_Drawer::PointAspect() const
{
- if (!HasOwnPointAspect())
+ if (myPointAspect.IsNull()
+ && !myLink.IsNull())
{
- if (!myLink.IsNull())
- {
- return myLink->PointAspect();
- }
- if (myPointAspect.IsNull())
- {
- myPointAspect = new Prs3d_PointAspect (Aspect_TOM_PLUS, Quantity_NOC_YELLOW, 1.0);
- }
+ return myLink->PointAspect();
}
return myPointAspect;
}
// =======================================================================
Standard_Boolean Prs3d_Drawer::SetupOwnPointAspect (const Handle(Prs3d_Drawer)& theDefaults)
{
- if (myHasOwnPointAspect)
+ if (!myPointAspect.IsNull())
{
return Standard_False;
}
myPointAspect = new Prs3d_PointAspect (Aspect_TOM_PLUS, Quantity_NOC_YELLOW, 1.0);
- if (!theDefaults.IsNull() && theDefaults != this)
- {
- *myPointAspect->Aspect() = *theDefaults->PointAspect()->Aspect();
- }
- else if (!myLink.IsNull())
+ const Handle(Prs3d_Drawer)& aLink = (!theDefaults.IsNull() && theDefaults != this) ? theDefaults : myLink;
+ if (const Prs3d_PointAspect* aLinked = !aLink.IsNull() ? aLink->PointAspect().get() : NULL)
{
- *myPointAspect->Aspect() = *myLink->PointAspect()->Aspect();
+ *myPointAspect->Aspect() = *aLinked->Aspect();
}
- myHasOwnPointAspect = Standard_True;
- return Standard_True;
-}
-
-// =======================================================================
-// function : SetPointAspect
-// purpose :
-// =======================================================================
-void Prs3d_Drawer::SetPointAspect (const Handle(Prs3d_PointAspect)& theAspect)
-{
- myPointAspect = theAspect;
- myHasOwnPointAspect = !myPointAspect.IsNull();
+ return Standard_True;
}
// =======================================================================
// purpose :
// =======================================================================
-const Handle(Prs3d_LineAspect)& Prs3d_Drawer::LineAspect()
+const Handle(Prs3d_LineAspect)& Prs3d_Drawer::LineAspect() const
{
- if (!HasOwnLineAspect())
+ if (myLineAspect.IsNull()
+ && !myLink.IsNull())
{
- if (!myLink.IsNull())
- {
- return myLink->LineAspect();
- }
- if (myLineAspect.IsNull())
- {
- myLineAspect = new Prs3d_LineAspect (THE_DEF_COLOR_Line, Aspect_TOL_SOLID, 1.0);
- }
+ return myLink->LineAspect();
}
return myLineAspect;
}
-// =======================================================================
-// function : SetLineAspect
-// purpose :
-// =======================================================================
-
-void Prs3d_Drawer::SetLineAspect (const Handle(Prs3d_LineAspect)& theAspect)
-{
- myLineAspect = theAspect;
- myHasOwnLineAspect = !myLineAspect.IsNull();
-}
-
// =======================================================================
// function : TextAspect
// purpose :
// =======================================================================
-const Handle(Prs3d_TextAspect)& Prs3d_Drawer::TextAspect()
+const Handle(Prs3d_TextAspect)& Prs3d_Drawer::TextAspect() const
{
- if (!HasOwnTextAspect())
+ if (myTextAspect.IsNull()
+ && !myLink.IsNull())
{
- if (!myLink.IsNull())
- {
- return myLink->TextAspect();
- }
- if (myTextAspect.IsNull())
- {
- myTextAspect = new Prs3d_TextAspect();
- }
+ return myLink->TextAspect();
}
return myTextAspect;
}
-// =======================================================================
-// function : SetTextAspect
-// purpose :
-// =======================================================================
-
-void Prs3d_Drawer::SetTextAspect (const Handle(Prs3d_TextAspect)& theAspect)
-{
- myTextAspect = theAspect;
- myHasOwnTextAspect = !myTextAspect.IsNull();
-}
-
// =======================================================================
// function : ShadingAspect
// purpose :
// =======================================================================
-const Handle(Prs3d_ShadingAspect)& Prs3d_Drawer::ShadingAspect()
+const Handle(Prs3d_ShadingAspect)& Prs3d_Drawer::ShadingAspect() const
{
- if (!HasOwnShadingAspect())
+ if (myShadingAspect.IsNull()
+ && !myLink.IsNull())
{
- if (!myLink.IsNull())
- {
- return myLink->ShadingAspect();
- }
- if (myShadingAspect.IsNull())
- {
- myShadingAspect = new Prs3d_ShadingAspect();
- }
+ return myLink->ShadingAspect();
}
return myShadingAspect;
}
// =======================================================================
Standard_Boolean Prs3d_Drawer::SetupOwnShadingAspect (const Handle(Prs3d_Drawer)& theDefaults)
{
- if (myHasOwnShadingAspect)
+ if (!myShadingAspect.IsNull())
{
return Standard_False;
}
myShadingAspect = new Prs3d_ShadingAspect();
- if (!theDefaults.IsNull() && theDefaults != this)
- {
- *myShadingAspect->Aspect() = *theDefaults->ShadingAspect()->Aspect();
- }
- else if (!myLink.IsNull())
+ const Handle(Prs3d_Drawer)& aLink = (!theDefaults.IsNull() && theDefaults != this) ? theDefaults : myLink;
+ if (const Prs3d_ShadingAspect* aLinked = !aLink.IsNull() ? aLink->ShadingAspect().get() : NULL)
{
- *myShadingAspect->Aspect() = *myLink->ShadingAspect()->Aspect();
+ *myShadingAspect->Aspect() = *aLinked->Aspect();
}
- myHasOwnShadingAspect = Standard_True;
return Standard_True;
}
-// =======================================================================
-// function : SetShadingAspect
-// purpose :
-// =======================================================================
-
-void Prs3d_Drawer::SetShadingAspect (const Handle(Prs3d_ShadingAspect)& theAspect)
-{
- myShadingAspect = theAspect;
- myHasOwnShadingAspect = !myShadingAspect.IsNull();
-}
-
// =======================================================================
// function : PlaneAspect
// purpose :
// =======================================================================
-const Handle(Prs3d_PlaneAspect)& Prs3d_Drawer::PlaneAspect()
+const Handle(Prs3d_PlaneAspect)& Prs3d_Drawer::PlaneAspect() const
{
- if (!HasOwnPlaneAspect())
+ if (myPlaneAspect.IsNull()
+ && !myLink.IsNull())
{
- if (!myLink.IsNull())
- {
- return myLink->PlaneAspect();
- }
- if (myPlaneAspect.IsNull())
- {
- myPlaneAspect = new Prs3d_PlaneAspect();
- }
+ return myLink->PlaneAspect();
}
return myPlaneAspect;
}
-// =======================================================================
-// function : SetPlaneAspect
-// purpose :
-// =======================================================================
-
-void Prs3d_Drawer::SetPlaneAspect (const Handle(Prs3d_PlaneAspect)& theAspect)
-{
- myPlaneAspect = theAspect;
- myHasOwnPlaneAspect = !myPlaneAspect.IsNull();
-}
-
// =======================================================================
// function : SeenLineAspect
// purpose :
// =======================================================================
-const Handle(Prs3d_LineAspect)& Prs3d_Drawer::SeenLineAspect()
+const Handle(Prs3d_LineAspect)& Prs3d_Drawer::SeenLineAspect() const
{
- if (!HasOwnSeenLineAspect())
+ if (mySeenLineAspect.IsNull()
+ && !myLink.IsNull())
{
- if (!myLink.IsNull())
- {
- return myLink->SeenLineAspect();
- }
- if (mySeenLineAspect.IsNull())
- {
- mySeenLineAspect = new Prs3d_LineAspect (THE_DEF_COLOR_SeenLine, Aspect_TOL_SOLID, 1.0);
- }
+ return myLink->SeenLineAspect();
}
return mySeenLineAspect;
}
-// =======================================================================
-// function : SetSeenLineAspect
-// purpose :
-// =======================================================================
-
-void Prs3d_Drawer::SetSeenLineAspect (const Handle(Prs3d_LineAspect)& theAspect)
-{
- mySeenLineAspect = theAspect;
- myHasOwnSeenLineAspect = !mySeenLineAspect.IsNull();
-}
-
// =======================================================================
// function : ArrowAspect
// purpose :
// =======================================================================
-const Handle(Prs3d_ArrowAspect)& Prs3d_Drawer::ArrowAspect()
+const Handle(Prs3d_ArrowAspect)& Prs3d_Drawer::ArrowAspect() const
{
- if (!HasOwnArrowAspect())
+ if (myArrowAspect.IsNull()
+ && !myLink.IsNull())
{
- if (!myLink.IsNull())
- {
- return myLink->ArrowAspect();
- }
- if (myArrowAspect.IsNull())
- {
- myArrowAspect = new Prs3d_ArrowAspect();
- }
+ return myLink->ArrowAspect();
}
return myArrowAspect;
}
-// =======================================================================
-// function : SetArrowAspect
-// purpose :
-// =======================================================================
-
-void Prs3d_Drawer::SetArrowAspect (const Handle(Prs3d_ArrowAspect)& theAspect)
-{
- myArrowAspect = theAspect;
- myHasOwnArrowAspect = !myArrowAspect.IsNull();
-}
-
// =======================================================================
// function : SetLineArrowDraw
// purpose :
// purpose :
// =======================================================================
-const Handle(Prs3d_LineAspect)& Prs3d_Drawer::HiddenLineAspect()
+const Handle(Prs3d_LineAspect)& Prs3d_Drawer::HiddenLineAspect() const
{
- if (!HasOwnHiddenLineAspect())
+ if (myHiddenLineAspect.IsNull()
+ && !myLink.IsNull())
{
- if (!myLink.IsNull())
- {
- return myLink->HiddenLineAspect();
- }
- if (myHiddenLineAspect.IsNull())
- {
- myHiddenLineAspect = new Prs3d_LineAspect (THE_DEF_COLOR_HiddenLine, Aspect_TOL_DASH, 1.0);
- }
+ return myLink->HiddenLineAspect();
}
return myHiddenLineAspect;
}
-// =======================================================================
-// function : SetHiddenLineAspect
-// purpose :
-// =======================================================================
-
-void Prs3d_Drawer::SetHiddenLineAspect (const Handle(Prs3d_LineAspect)& theAspect)
-{
- myHiddenLineAspect = theAspect;
- myHasOwnHiddenLineAspect = !myHiddenLineAspect.IsNull();
-}
-
// =======================================================================
// function : EnableDrawHiddenLineDraw
// purpose :
// purpose :
// =======================================================================
-const Handle(Prs3d_LineAspect)& Prs3d_Drawer::VectorAspect()
+const Handle(Prs3d_LineAspect)& Prs3d_Drawer::VectorAspect() const
{
- if (!HasOwnVectorAspect())
+ if (myVectorAspect.IsNull()
+ && !myLink.IsNull())
{
- if (!myLink.IsNull())
- {
- return myLink->VectorAspect();
- }
- if (myVectorAspect.IsNull())
- {
- myVectorAspect = new Prs3d_LineAspect (THE_DEF_COLOR_Vector, Aspect_TOL_SOLID, 1.0);
- }
+ return myLink->VectorAspect();
}
return myVectorAspect;
}
-// =======================================================================
-// function : SetVectorAspect
-// purpose :
-// =======================================================================
-
-void Prs3d_Drawer::SetVectorAspect (const Handle(Prs3d_LineAspect)& theAspect)
-{
- myVectorAspect = theAspect;
- myHasOwnVectorAspect = !myVectorAspect.IsNull();
-}
-
// =======================================================================
// function : SetVertexDrawMode
// purpose :
// purpose :
// =======================================================================
-Prs3d_VertexDrawMode Prs3d_Drawer::VertexDrawMode()
+Prs3d_VertexDrawMode Prs3d_Drawer::VertexDrawMode() const
{
- if (!HasOwnVertexDrawMode())
+ if (HasOwnVertexDrawMode())
{
- if (!myLink.IsNull())
- {
- return myLink->VertexDrawMode();
- }
- // Prs3d_VDM_Isolated is default value for this setting.
- myVertexDrawMode = Prs3d_VDM_Isolated;
+ return myVertexDrawMode;
+ }
+ else if (!myLink.IsNull())
+ {
+ return myLink->VertexDrawMode();
}
- return myVertexDrawMode;
+ return Prs3d_VDM_Isolated;
}
// =======================================================================
// purpose :
// =======================================================================
-const Handle(Prs3d_DatumAspect)& Prs3d_Drawer::DatumAspect()
+const Handle(Prs3d_DatumAspect)& Prs3d_Drawer::DatumAspect() const
{
- if (!HasOwnDatumAspect())
+ if (myDatumAspect.IsNull()
+ && !myLink.IsNull())
{
- if (!myLink.IsNull())
- {
- return myLink->DatumAspect();
- }
- if (myDatumAspect.IsNull())
- {
- myDatumAspect = new Prs3d_DatumAspect();
- }
+ return myLink->DatumAspect();
}
return myDatumAspect;
}
-// =======================================================================
-// function : SetDatumAspect
-// purpose :
-// =======================================================================
-
-void Prs3d_Drawer::SetDatumAspect (const Handle(Prs3d_DatumAspect)& theAspect)
-{
- myDatumAspect = theAspect;
- myHasOwnDatumAspect = !myDatumAspect.IsNull();
-}
-
// =======================================================================
// function : SectionAspect
// purpose :
// =======================================================================
-const Handle(Prs3d_LineAspect)& Prs3d_Drawer::SectionAspect()
+const Handle(Prs3d_LineAspect)& Prs3d_Drawer::SectionAspect() const
{
- if (!HasOwnSectionAspect())
+ if (mySectionAspect.IsNull()
+ && !myLink.IsNull())
{
- if (!myLink.IsNull())
- {
- return myLink->SectionAspect();
- }
- if (mySectionAspect.IsNull())
- {
- mySectionAspect = new Prs3d_LineAspect (THE_DEF_COLOR_Section, Aspect_TOL_SOLID, 1.0);
- }
+ return myLink->SectionAspect();
}
return mySectionAspect;
}
// purpose :
// =======================================================================
-void Prs3d_Drawer::SetSectionAspect (const Handle(Prs3d_LineAspect)& theAspect)
-{
- mySectionAspect = theAspect;
- myHasOwnSectionAspect = !mySectionAspect.IsNull();
-}
-
-// =======================================================================
-// function : SetSectionAspect
-// purpose :
-// =======================================================================
-
void Prs3d_Drawer::ClearLocalAttributes()
{
if (myLink.IsNull())
myDimensionAspect.Nullify();
mySectionAspect.Nullify();
- myHasOwnUIsoAspect = Standard_False;
- myHasOwnVIsoAspect = Standard_False;
- myHasOwnWireAspect = Standard_False;
- myHasOwnPointAspect = Standard_False;
- myHasOwnLineAspect = Standard_False;
- myHasOwnTextAspect = Standard_False;
- myHasOwnShadingAspect = Standard_False;
- myHasOwnPlaneAspect = Standard_False;
- myHasOwnSeenLineAspect = Standard_False;
- myHasOwnArrowAspect = Standard_False;
- myHasOwnHiddenLineAspect = Standard_False;
- myHasOwnVectorAspect = Standard_False;
- myHasOwnDatumAspect = Standard_False;
- myHasOwnSectionAspect = Standard_False;
- myHasOwnFreeBoundaryAspect = Standard_False;
- myHasOwnUnFreeBoundaryAspect = Standard_False;
- myHasOwnFaceBoundaryAspect = Standard_False;
- myHasOwnDimensionAspect = Standard_False;
-
UnsetOwnDiscretisation();
UnsetOwnMaximalParameterValue();
UnsetOwnTypeOfDeflection();
// =======================================================================
Standard_Boolean Prs3d_Drawer::SetupOwnFaceBoundaryAspect (const Handle(Prs3d_Drawer)& theDefaults)
{
- if (myHasOwnFaceBoundaryAspect)
+ if (!myFaceBoundaryAspect.IsNull())
{
return false;
}
myFaceBoundaryAspect = new Prs3d_LineAspect (THE_DEF_COLOR_FaceBoundary, Aspect_TOL_SOLID, 1.0);
- myHasOwnFaceBoundaryAspect = true;
const Handle(Prs3d_Drawer)& aLink = (!theDefaults.IsNull() && theDefaults != this) ? theDefaults : myLink;
- if (!aLink.IsNull())
+ if (const Prs3d_LineAspect* aLinked = !aLink.IsNull() ? aLink->FaceBoundaryAspect().get() : NULL)
{
- *myFaceBoundaryAspect->Aspect() = *aLink->FaceBoundaryAspect()->Aspect();
+ *myFaceBoundaryAspect->Aspect() = *aLinked->Aspect();
}
return true;
}
{
bool isUpdateNeeded = false;
const Handle(Prs3d_Drawer)& aLink = (!theDefaults.IsNull() && theDefaults != this) ? theDefaults : myLink;
- if (!myHasOwnUIsoAspect)
+ if (myUIsoAspect.IsNull())
{
isUpdateNeeded = true;
myUIsoAspect = new Prs3d_IsoAspect (Quantity_NOC_GRAY75, Aspect_TOL_SOLID, 1.0, 1);
- if (!aLink.IsNull())
+ if (const Prs3d_IsoAspect* aLinked = !aLink.IsNull() ? aLink->UIsoAspect().get() : NULL)
{
- *myUIsoAspect->Aspect() = *aLink->UIsoAspect()->Aspect();
- myUIsoAspect->SetNumber (aLink->UIsoAspect()->Number());
+ *myUIsoAspect->Aspect() = *aLinked->Aspect();
+ myUIsoAspect->SetNumber (aLinked->Number());
}
- myHasOwnUIsoAspect = true;
}
- if (!myHasOwnVIsoAspect)
+ if (myVIsoAspect.IsNull())
{
isUpdateNeeded = true;
myVIsoAspect = new Prs3d_IsoAspect (Quantity_NOC_GRAY75, Aspect_TOL_SOLID, 1.0, 1);
- if (!aLink.IsNull())
+ if (const Prs3d_IsoAspect* aLinked = !aLink.IsNull() ? aLink->VIsoAspect().get() : NULL)
{
- *myVIsoAspect->Aspect() = *aLink->VIsoAspect()->Aspect();
- myVIsoAspect->SetNumber (aLink->VIsoAspect()->Number());
+ *myVIsoAspect->Aspect() = *aLinked->Aspect();
+ myVIsoAspect->SetNumber (aLinked->Number());
}
- myHasOwnVIsoAspect = true;
}
- if (!myHasOwnWireAspect)
+ if (myWireAspect.IsNull())
{
isUpdateNeeded = true;
myWireAspect = new Prs3d_LineAspect (THE_DEF_COLOR_Wire, Aspect_TOL_SOLID, 1.0);
- myHasOwnWireAspect = true;
- if (!aLink.IsNull())
+ if (const Prs3d_LineAspect* aLinked = !aLink.IsNull() ? aLink->WireAspect().get() : NULL)
{
- *myWireAspect->Aspect() = *aLink->WireAspect()->Aspect();
+ *myWireAspect->Aspect() = *aLinked->Aspect();
}
}
- if (!myHasOwnLineAspect)
+ if (myLineAspect.IsNull())
{
isUpdateNeeded = true;
myLineAspect = new Prs3d_LineAspect (THE_DEF_COLOR_Line, Aspect_TOL_SOLID, 1.0);
- myHasOwnLineAspect = true;
- if (!aLink.IsNull())
+ if (const Prs3d_LineAspect* aLinked = !aLink.IsNull() ? aLink->LineAspect().get() : NULL)
{
- *myLineAspect->Aspect() = *aLink->LineAspect()->Aspect();
+ *myLineAspect->Aspect() = *aLinked->Aspect();
}
}
- if (!myHasOwnSeenLineAspect)
+ if (mySeenLineAspect.IsNull())
{
isUpdateNeeded = true;
mySeenLineAspect = new Prs3d_LineAspect (THE_DEF_COLOR_SeenLine, Aspect_TOL_SOLID, 1.0);
- myHasOwnSeenLineAspect = true;
- if (!aLink.IsNull())
+ if (const Prs3d_LineAspect* aLinked = !aLink.IsNull() ? aLink->SeenLineAspect().get() : NULL)
{
- *mySeenLineAspect->Aspect() = *aLink->SeenLineAspect()->Aspect();
+ *mySeenLineAspect->Aspect() = *aLinked->Aspect();
}
}
- if (!myHasOwnHiddenLineAspect)
+ if (myHiddenLineAspect.IsNull())
{
isUpdateNeeded = true;
myHiddenLineAspect = new Prs3d_LineAspect (THE_DEF_COLOR_HiddenLine, Aspect_TOL_DASH, 1.0);
- myHasOwnHiddenLineAspect = true;
- if (!aLink.IsNull())
+ if (const Prs3d_LineAspect* aLinked = !aLink.IsNull() ? aLink->HiddenLineAspect().get() : NULL)
{
- *myHiddenLineAspect->Aspect() = *aLink->HiddenLineAspect()->Aspect();
+ *myHiddenLineAspect->Aspect() = *aLinked->Aspect();
}
}
- if (!myHasOwnFreeBoundaryAspect)
+ if (myFreeBoundaryAspect.IsNull())
{
isUpdateNeeded = true;
myFreeBoundaryAspect = new Prs3d_LineAspect (THE_DEF_COLOR_FreeBoundary, Aspect_TOL_SOLID, 1.0);
- myHasOwnFreeBoundaryAspect = true;
- if (!aLink.IsNull())
+ if (const Prs3d_LineAspect* aLinked = !aLink.IsNull() ? aLink->FreeBoundaryAspect().get() : NULL)
{
- *myFreeBoundaryAspect->Aspect() = *aLink->FreeBoundaryAspect()->Aspect();
+ *myFreeBoundaryAspect->Aspect() = *aLinked->Aspect();
}
}
- if (!myHasOwnUnFreeBoundaryAspect)
+ if (myUnFreeBoundaryAspect.IsNull())
{
isUpdateNeeded = true;
myUnFreeBoundaryAspect = new Prs3d_LineAspect (THE_DEF_COLOR_UnFreeBoundary, Aspect_TOL_SOLID, 1.0);
- myHasOwnUnFreeBoundaryAspect = true;
- if (!aLink.IsNull())
+ if (const Prs3d_LineAspect* aLinked = !aLink.IsNull() ? aLink->UnFreeBoundaryAspect().get() : NULL)
{
- *myUnFreeBoundaryAspect->Aspect() = *aLink->UnFreeBoundaryAspect()->Aspect();
+ *myUnFreeBoundaryAspect->Aspect() = *aLinked->Aspect();
}
}
isUpdateNeeded = SetupOwnFaceBoundaryAspect (theDefaults) || isUpdateNeeded;
{
bool isUpdateNeeded = false;
const Handle(Prs3d_Drawer)& aLink = (!theDefaults.IsNull() && theDefaults != this) ? theDefaults : myLink;
- if (!myHasOwnVectorAspect)
+ if (myVectorAspect.IsNull())
{
isUpdateNeeded = true;
myVectorAspect = new Prs3d_LineAspect (THE_DEF_COLOR_Vector, Aspect_TOL_SOLID, 1.0);
- myHasOwnVectorAspect = true;
- if (!aLink.IsNull())
+ if (const Prs3d_LineAspect* aLinked = !aLink.IsNull() ? aLink->VectorAspect().get() : NULL)
{
- *myVectorAspect->Aspect() = *aLink->VectorAspect()->Aspect();
+ *myVectorAspect->Aspect() = *aLinked->Aspect();
}
}
- if (!myHasOwnSectionAspect)
+ if (mySectionAspect.IsNull())
{
isUpdateNeeded = true;
mySectionAspect = new Prs3d_LineAspect (THE_DEF_COLOR_Section, Aspect_TOL_SOLID, 1.0);
- myHasOwnSectionAspect = true;
- if (!aLink.IsNull())
+ if (const Prs3d_LineAspect* aLinked = !aLink.IsNull() ? aLink->SectionAspect().get() : NULL)
{
- *mySectionAspect->Aspect() = *aLink->SectionAspect()->Aspect();
+ *mySectionAspect->Aspect() = *aLinked->Aspect();
}
}
- if (!myHasOwnPlaneAspect)
+ if (myPlaneAspect.IsNull())
{
isUpdateNeeded = true;
myPlaneAspect = new Prs3d_PlaneAspect();
- myHasOwnPlaneAspect = true;
}
- if (!myHasOwnArrowAspect)
+ if (myArrowAspect.IsNull())
{
isUpdateNeeded = true;
myArrowAspect = new Prs3d_ArrowAspect();
- myHasOwnArrowAspect = true;
}
- if (!myHasOwnDatumAspect)
+ if (myDatumAspect.IsNull())
{
isUpdateNeeded = true;
myDatumAspect = new Prs3d_DatumAspect();
- if (!aLink.IsNull()
- && aLink->HasOwnDatumAspect())
+ if (const Prs3d_DatumAspect* aLinked = !aLink.IsNull() ? aLink->DatumAspect().get() : NULL)
{
- myDatumAspect->CopyAspectsFrom (aLink->DatumAspect());
+ myDatumAspect->CopyAspectsFrom (aLinked);
}
- myHasOwnDatumAspect = true;
}
return isUpdateNeeded;
}
//! Assign the shader program.
template <typename T>
inline void setAspectProgram (const Handle(Graphic3d_ShaderProgram)& theProgram,
- bool theHasAspect,
T thePrsAspect)
{
- if (!thePrsAspect.IsNull()
- && theHasAspect)
+ if (!thePrsAspect.IsNull())
{
thePrsAspect->Aspect()->SetShaderProgram (theProgram);
}
isUpdateNeeded = SetOwnDatumAspects() || isUpdateNeeded;
}
- setAspectProgram (theProgram, myHasOwnUIsoAspect, myUIsoAspect);
- setAspectProgram (theProgram, myHasOwnVIsoAspect, myVIsoAspect);
- setAspectProgram (theProgram, myHasOwnWireAspect, myWireAspect);
- setAspectProgram (theProgram, myHasOwnLineAspect, myLineAspect);
- setAspectProgram (theProgram, myHasOwnSeenLineAspect, mySeenLineAspect);
- setAspectProgram (theProgram, myHasOwnHiddenLineAspect, myHiddenLineAspect);
- setAspectProgram (theProgram, myHasOwnVectorAspect, myVectorAspect);
- setAspectProgram (theProgram, myHasOwnSectionAspect, mySectionAspect);
- setAspectProgram (theProgram, myHasOwnFreeBoundaryAspect, myFreeBoundaryAspect);
- setAspectProgram (theProgram, myHasOwnUnFreeBoundaryAspect, myUnFreeBoundaryAspect);
- setAspectProgram (theProgram, myHasOwnFaceBoundaryAspect, myFaceBoundaryAspect);
- if (myHasOwnPlaneAspect)
+ setAspectProgram (theProgram, myUIsoAspect);
+ setAspectProgram (theProgram, myVIsoAspect);
+ setAspectProgram (theProgram, myWireAspect);
+ setAspectProgram (theProgram, myLineAspect);
+ setAspectProgram (theProgram, mySeenLineAspect);
+ setAspectProgram (theProgram, myHiddenLineAspect);
+ setAspectProgram (theProgram, myVectorAspect);
+ setAspectProgram (theProgram, mySectionAspect);
+ setAspectProgram (theProgram, myFreeBoundaryAspect);
+ setAspectProgram (theProgram, myUnFreeBoundaryAspect);
+ setAspectProgram (theProgram, myFaceBoundaryAspect);
+ if (!myPlaneAspect.IsNull())
{
- setAspectProgram (theProgram, true, myPlaneAspect->EdgesAspect());
- setAspectProgram (theProgram, true, myPlaneAspect->IsoAspect());
- setAspectProgram (theProgram, true, myPlaneAspect->ArrowAspect());
+ setAspectProgram (theProgram, myPlaneAspect->EdgesAspect());
+ setAspectProgram (theProgram, myPlaneAspect->IsoAspect());
+ setAspectProgram (theProgram, myPlaneAspect->ArrowAspect());
}
- if (myHasOwnDatumAspect)
+ if (!myDatumAspect.IsNull())
{
- setAspectProgram (theProgram, true, myDatumAspect->LineAspect(Prs3d_DatumParts_XAxis));
- setAspectProgram (theProgram, true, myDatumAspect->LineAspect(Prs3d_DatumParts_YAxis));
- setAspectProgram (theProgram, true, myDatumAspect->LineAspect(Prs3d_DatumParts_ZAxis));
+ setAspectProgram (theProgram, myDatumAspect->LineAspect (Prs3d_DatumParts_XAxis));
+ setAspectProgram (theProgram, myDatumAspect->LineAspect (Prs3d_DatumParts_YAxis));
+ setAspectProgram (theProgram, myDatumAspect->LineAspect (Prs3d_DatumParts_ZAxis));
}
- setAspectProgram (theProgram, myHasOwnArrowAspect, myArrowAspect);
+ setAspectProgram (theProgram, myArrowAspect);
return isUpdateNeeded;
}
case Graphic3d_ASPECT_TEXT:
{
if (theToOverrideDefaults
- && !myHasOwnTextAspect)
+ && myTextAspect.IsNull())
{
isUpdateNeeded = true;
myTextAspect = new Prs3d_TextAspect();
- myHasOwnTextAspect = true;
- if (!myLink.IsNull())
+ if (const Prs3d_TextAspect* aLinked = !myLink.IsNull() ? myLink->TextAspect().get() : NULL)
{
- *myTextAspect->Aspect() = *myLink->TextAspect()->Aspect();
+ *myTextAspect->Aspect() = *aLinked->Aspect();
}
}
- setAspectProgram (theProgram, myHasOwnTextAspect, myTextAspect);
+ setAspectProgram (theProgram, myTextAspect);
return isUpdateNeeded;
}
case Graphic3d_ASPECT_MARKER:
isUpdateNeeded = true;
}
- setAspectProgram (theProgram, myHasOwnPointAspect, myPointAspect);
+ setAspectProgram (theProgram, myPointAspect);
return isUpdateNeeded;
}
case Graphic3d_ASPECT_FILL_AREA:
{
isUpdateNeeded = true;
}
- setAspectProgram (theProgram, myHasOwnShadingAspect, myShadingAspect);
+ setAspectProgram (theProgram, myShadingAspect);
return isUpdateNeeded;
}
}
isUpdateNeeded = true;
}
- if (!myShadingAspect.IsNull()
- && myHasOwnShadingAspect)
+ if (!myShadingAspect.IsNull())
{
myShadingAspect->Aspect()->SetShadingModel (theModel);
}
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myLink.get())
- OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnNbPoints)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myMaximalParameterValue)
- OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnMaximalParameterValue)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myChordialDeviation)
- OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnChordialDeviation)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTypeOfDeflection)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnTypeOfDeflection)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTypeOfHLR)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDeviationCoefficient)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myPreviousDeviationCoefficient)
- OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnDeviationCoefficient)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDeviationAngle)
- OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnDeviationAngle)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myPreviousDeviationAngle)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsoOnPlane)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnIsoOnPlane)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsAutoTriangulated)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnIsAutoTriangulated)
- OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnUIsoAspect)
-
- OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnVIsoAspect)
-
- OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnWireAspect)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myWireDraw)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnWireDraw)
- OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnPointAspect)
-
- OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnLineAspect)
-
- OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myTextAspect.get())
-
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myShadingAspect.get())
- OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnShadingAspect)
-
- OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnPlaneAspect)
-
- OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnSeenLineAspect)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myTextAspect.get())
- OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnArrowAspect)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myLineArrowDraw)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnLineArrowDraw)
- OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnHiddenLineAspect)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDrawHiddenLine)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnDrawHiddenLine)
- OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnVectorAspect)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myVertexDrawMode)
- OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnDatumAspect)
-
- OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnSectionAspect)
-
- OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnFreeBoundaryAspect)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFreeBoundaryDraw)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnFreeBoundaryDraw)
- OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnUnFreeBoundaryAspect)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myUnFreeBoundaryDraw)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnUnFreeBoundaryDraw)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFaceBoundaryUpperContinuity)
- OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnFaceBoundaryAspect)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFaceBoundaryDraw)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnFaceBoundaryDraw)
- OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnDimensionAspect)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnDimLengthModelUnits)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnDimAngleModelUnits)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnDimLengthDisplayUnits)
//! 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);
//! 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.
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.
//! 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;
}
//! Updates the previous value used for the chordal deviation coefficient to the current state.
void UpdatePreviousDeviationCoefficient()
{
- if (myHasOwnDeviationCoefficient)
+ if (HasOwnDeviationCoefficient())
{
myPreviousDeviationCoefficient = DeviationCoefficient();
}
//! 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;
}
//! Updates the previous deviation angle to the current value
void UpdatePreviousDeviationAngle()
{
- if (myHasOwnDeviationAngle)
+ if (HasOwnDeviationAngle())
{
myPreviousDeviationAngle = DeviationAngle();
}
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; }
-
- //! 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
+ Standard_Boolean HasOwnUIsoAspect() const { return !myUIsoAspect.IsNull(); }
+
+ //! 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; }
-
- //! 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
+ Standard_Boolean HasOwnVIsoAspect() const { return !myVIsoAspect.IsNull(); }
+
+ //! 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);
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)());
//! 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; }
-
- //! 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();
+ Standard_Boolean HasOwnTextAspect() const { return !myTextAspect.IsNull(); }
+
+ //! 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.
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.
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,
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);
-
- //! 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
+ void SetFreeBoundaryAspect (const Handle(Prs3d_LineAspect)& theAspect)
+ {
+ myFreeBoundaryAspect = theAspect;
+ }
+
+ //! 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
//! 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);
-
- //! 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.
+ void SetUnFreeBoundaryAspect (const Handle(Prs3d_LineAspect)& theAspect)
+ {
+ myUnFreeBoundaryAspect = theAspect;
+ }
+
+ //! 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
//! 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)());
//! 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
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(); }
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;
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;