0025773: Visualization - remove AIS_Drawer class and transfer its Link() logic to...
authorosa <osa@opencascade.com>
Mon, 2 Mar 2015 13:17:29 +0000 (16:17 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 5 Mar 2015 10:25:18 +0000 (13:25 +0300)
104 files changed:
samples/mfc/occtdemo/Common/ISession/ISession_Curve.cpp
samples/mfc/occtdemo/Common/OCCDemo_Presentation.cpp
samples/mfc/occtdemo/HLR/HLR_Presentation.cpp
samples/mfc/occtdemo/Intersections/Intersections_Presentation.cpp
samples/mfc/occtdemo/SplitShape/SplitShape_Presentation.cpp
samples/mfc/occtdemo/Textures/Textures_Presentation.cpp
samples/mfc/occtdemo/Transform/Transform_Presentation.cpp
samples/mfc/standard/01_Geometry/src/GeomSources.cpp
samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Curve.cpp
samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Surface.cpp
samples/mfc/standard/01_Geometry/src/StdAfx.h
samples/mfc/standard/02_Modeling/src/ISession_Direction.cpp
samples/mfc/standard/03_Viewer2d/src/StdAfx.h
samples/mfc/standard/03_Viewer2d/src/Viewer2dDoc.cpp
samples/mfc/standard/04_Viewer3d/src/ISession_Curve.cpp
samples/mfc/standard/04_Viewer3d/src/OCCDemo_Presentation.cpp
samples/mfc/standard/05_ImportExport/src/StdAfx.h
samples/mfc/standard/06_Ocaf/src/StdAfx.h
samples/mfc/standard/07_Triangulation/src/ISession_Curve.cpp
samples/mfc/standard/07_Triangulation/src/OCCDemo_Presentation.cpp
samples/mfc/standard/08_HLR/src/StdAfx.h
samples/mfc/standard/09_Animation/src/StdAfx.h
samples/mfc/standard/10_Convert/src/ISession/ISession_Curve.cpp
samples/mfc/standard/10_Convert/src/OCCDemo_Presentation.cpp
samples/mfc/standard/Common/AISDialogs.cpp
samples/mfc/standard/Common/StdAfx.h
src/AIS/AIS.cdl
src/AIS/AIS.cxx
src/AIS/AIS_AngleDimension.cxx
src/AIS/AIS_Axis.cxx
src/AIS/AIS_Chamf2dDimension.cxx
src/AIS/AIS_Chamf3dDimension.cxx
src/AIS/AIS_Circle.cxx
src/AIS/AIS_ColoredShape.cxx
src/AIS/AIS_ColoredShape.hxx
src/AIS/AIS_ConnectedInteractive.cxx
src/AIS/AIS_Dimension.hxx
src/AIS/AIS_Drawer.cdl [deleted file]
src/AIS/AIS_Drawer.cxx [deleted file]
src/AIS/AIS_Drawer.lxx [deleted file]
src/AIS/AIS_EqualDistanceRelation.cdl
src/AIS/AIS_EqualDistanceRelation.cxx
src/AIS/AIS_EqualRadiusRelation.cxx
src/AIS/AIS_IdenticRelation.cxx
src/AIS/AIS_InteractiveContext.cdl
src/AIS/AIS_InteractiveContext.cxx
src/AIS/AIS_InteractiveObject.cdl
src/AIS/AIS_InteractiveObject.cxx
src/AIS/AIS_InteractiveObject.lxx
src/AIS/AIS_LengthDimension.hxx
src/AIS/AIS_Line.cxx
src/AIS/AIS_MaxRadiusDimension.cxx
src/AIS/AIS_MidPointRelation.cxx
src/AIS/AIS_MinRadiusDimension.cxx
src/AIS/AIS_OffsetDimension.cxx
src/AIS/AIS_ParallelRelation.cxx
src/AIS/AIS_Plane.cxx
src/AIS/AIS_PlaneTrihedron.cxx
src/AIS/AIS_Point.cxx
src/AIS/AIS_PointCloud.cxx
src/AIS/AIS_Relation.cxx
src/AIS/AIS_Shape.cdl
src/AIS/AIS_Shape.cxx
src/AIS/AIS_Shape.lxx
src/AIS/AIS_SymmetricRelation.cxx
src/AIS/AIS_TexturedShape.cxx
src/AIS/AIS_Triangulation.cxx
src/AIS/AIS_Trihedron.cdl
src/AIS/AIS_Trihedron.cxx
src/DPrsStd/DPrsStd_AISPresentationCommands.cxx
src/MPrsStd/MPrsStd_AISPresentationRetrievalDriver.cxx
src/MPrsStd/MPrsStd_AISPresentationRetrievalDriver_1.cxx
src/MPrsStd/MPrsStd_AISPresentationStorageDriver.cxx
src/MeshVS/MeshVS_NodalColorPrsBuilder.cxx
src/Prs3d/FILES
src/Prs3d/Prs3d.cdl
src/Prs3d/Prs3d_Drawer.cdl [deleted file]
src/Prs3d/Prs3d_Drawer.cxx
src/Prs3d/Prs3d_Drawer.hxx [new file with mode: 0644]
src/Prs3d/Prs3d_IsoAspect.cdl
src/QABugs/QABugs_17.cxx
src/QABugs/QABugs_4.cxx
src/QABugs/QABugs_MyText.cxx
src/QABugs/QABugs_PresentableObject.cxx
src/SelectMgr/SelectMgr_SelectableObject.cdl
src/SelectMgr/SelectMgr_SelectableObject.cxx
src/SelectMgr/SelectMgr_SelectableObject.lxx
src/StdPrs/StdPrs_ShadedShape.cxx
src/TPrsStd/TPrsStd.cdl
src/TPrsStd/TPrsStd_AISPresentation.cdl
src/TPrsStd/TPrsStd_AxisDriver.cxx
src/TPrsStd/TPrsStd_ConstraintDriver.cxx
src/TPrsStd/TPrsStd_ConstraintTools.cxx
src/TPrsStd/TPrsStd_GeometryDriver.cxx
src/TPrsStd/TPrsStd_PlaneDriver.cxx
src/TPrsStd/TPrsStd_PointDriver.cxx
src/ViewerTest/ViewerTest.cxx
src/ViewerTest/ViewerTest_ObjectCommands.cxx
src/ViewerTest/ViewerTest_OpenGlCommands.cxx
src/ViewerTest/ViewerTest_ViewerCommands.cxx
src/XCAFPrs/XCAFPrs_AISObject.cxx
src/XCAFPrs/XCAFPrs_AISObject.hxx
src/XDEDRAW/XDEDRAW.cxx
tests/bugs/vis/bug25773 [new file with mode: 0644]

index f200379..814474a 100755 (executable)
@@ -7,7 +7,7 @@
 #include <Prs3d_LineAspect.hxx>
 #include <StdPrs_Curve.hxx>
 #include <GeomAdaptor_Curve.hxx>
-#include <AIS_Drawer.hxx>
+#include <Prs3d_Drawer.hxx>
 #include <Prs3d_ArrowAspect.hxx>
 
 
index b8e9129..091c20c 100755 (executable)
@@ -17,7 +17,7 @@
 #include <Precision.hxx>
 #include <Geom_Line.hxx>
 #include <Geom_TrimmedCurve.hxx>
-#include <AIS_Drawer.hxx>
+#include <Prs_Drawer.hxx>
 #include <Prs3d_ArrowAspect.hxx>
 #include <AIS_Point.hxx>
 #include <Geom_CartesianPoint.hxx>
index 4a8c1ec..d27724f 100755 (executable)
@@ -15,7 +15,7 @@
 #include <HLRBRep_PolyAlgo.hxx>
 #include <HLRBRep_PolyHLRToShape.hxx>
 #include <Prs3d_LineAspect.hxx>
-#include <AIS_Drawer.hxx>
+#include <Prs3d_Drawer.hxx>
 #include <BRepTools.hxx>
 #include <BRepMesh.hxx>
 #include <BRep_Builder.hxx>
index 0b04e12..d5d259e 100755 (executable)
@@ -21,7 +21,7 @@
 #include <gp_Pnt2d.hxx>
 #include <gp_Dir.hxx>
 #include <gp_Ax2.hxx>
-#include <AIS_Drawer.hxx>
+#include <Prs3d_Drawer.hxx>
 #include <Prs3d_LineAspect.hxx>
 
 
index 60bc0c6..8fc4c90 100755 (executable)
@@ -24,7 +24,7 @@
 #include <TopoDS_Iterator.hxx>
 #include <TopoDS_Wire.hxx>
 #include <Prs3d_LineAspect.hxx>
-#include <AIS_Drawer.hxx>
+#include <Prs3d_Drawer.hxx>
 #include <TopLoc_Location.hxx>
 #include <BRepOffsetAPI_MakeOffset.hxx>
 #include <BRepBuilderAPI_MakePolygon.hxx>
index f4d079f..ccbbe01 100755 (executable)
@@ -31,7 +31,7 @@
 #include <V3d_PositionalLight.hxx>
 #include <V3d_DirectionalLight.hxx>
 #include <V3d_SpotLight.hxx>
-#include <AIS_Drawer.hxx>
+#include <Prs3d_Drawer.hxx>
 #include <Prs3d_ShadingAspect.hxx>
 #include <Graphic3d_AspectFillArea3d.hxx>
 #include <Graphic3d_Texture2D.hxx>
index 6ac2e35..08c6996 100755 (executable)
@@ -12,7 +12,7 @@
 #include <Geom_Line.hxx>
 #include <Geom_Circle.hxx>
 #include <Geom_TrimmedCurve.hxx>
-#include <AIS_Drawer.hxx>
+#include <Prs3d_Drawer.hxx>
 #include <Prs3d_ArrowAspect.hxx>
 #include <Geom_Plane.hxx>
 #include <Geom_RectangularTrimmedSurface.hxx>
@@ -231,7 +231,7 @@ void Transform_Presentation::sample1()
   gp_Ax2 ax2(ax1Pnt.Translated(gp_Vec(0,0,70)),ax1Dir);
   Handle(Geom_Curve) aCirc = new Geom_TrimmedCurve(new Geom_Circle(ax2,20),0,angle);
   Handle(AIS_InteractiveObject) aICirc = drawCurve(aCirc,Quantity_NOC_WHITE,Standard_False);
-  Handle(AIS_Drawer) aDrawer = new AIS_Drawer;
+  Handle(Prs3d_Drawer) aDrawer = new Prs3d_Drawer;
   aDrawer->Link()->SetLineArrowDraw(Standard_True);
   aDrawer->Link()->ArrowAspect()->SetLength(2);
   getAISContext()->SetLocalAttributes (aICirc, aDrawer);
index 24af7f8..5e948d1 100755 (executable)
@@ -955,7 +955,7 @@ if(NbResults>0){                                          \n\
  DisplayPoint(aDoc,N,aString.ToCString(),false,0.5,0,-0.6);
 
  Handle(ISession_Surface) aSurface = new ISession_Surface(SP);
- Handle (AIS_Drawer) CurDrawer = aSurface->Attributes();
+ Handle(Prs3d_Drawer) CurDrawer = aSurface->Attributes();
  CurDrawer->UIsoAspect()->SetNumber(10);
  CurDrawer->VIsoAspect()->SetNumber(10);
  aDoc->GetAISContext()->SetLocalAttributes(aSurface, CurDrawer);
index e649376..1a25812 100755 (executable)
@@ -35,7 +35,7 @@ void ISession_Curve::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPres
                              const Standard_Integer aMode)
 {
     GeomAdaptor_Curve anAdaptorCurve(myCurve);
-    Handle(AIS_Drawer) aDrawer = new AIS_Drawer();
+    Handle(Prs3d_Drawer) aDrawer = new Prs3d_Drawer();
     aDrawer->LineAspect()->SetColor(Quantity_NOC_RED);
 
     switch (aMode)
index dccb298..2c4a106 100755 (executable)
@@ -39,7 +39,7 @@ void ISession_Surface::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPr
     GeomAdaptor_Surface anAdaptorSurface(mySurface);
     Handle(GeomAdaptor_HSurface) anAdaptorHSurface = new GeomAdaptor_HSurface(mySurface);
 
-    Handle(AIS_Drawer) aDrawer = new AIS_Drawer();
+    Handle(Prs3d_Drawer) aDrawer = new Prs3d_Drawer();
     aDrawer->LineAspect()->SetColor(Quantity_NOC_YELLOW3);
 
     switch (aMode)
index 9a0a926..0a91b8f 100755 (executable)
@@ -84,7 +84,6 @@
 #include <AIS_InteractiveContext.hxx>
 #include <AIS_Shape.hxx>
 #include <AIS_Point.hxx>
-#include <AIS_Drawer.hxx>
 #include <Aspect_Grid.hxx>
 #include <Aspect_Window.hxx>
 #include <Aspect_Background.hxx>
 #include <Poly_Triangulation.hxx>
 #include <Precision.hxx>
 #include <Prs3d_Arrow.hxx>
+#include <Prs3d_Drawer.hxx>
 #include <Prs3d_Root.hxx>
 #include <Prs3d_Text.hxx>
 #include <Prs3d_ArrowAspect.hxx>
index ab99968..97a5c53 100755 (executable)
@@ -15,7 +15,7 @@ IMPLEMENT_STANDARD_RTTIEXT(ISession_Direction,AIS_InteractiveObject)
 
 #include "DsgPrs_LengthPresentation.hxx"
 #include "Prs3d_ArrowAspect.hxx"
-#include "AIS_Drawer.hxx"
+#include "Prs3d_Drawer.hxx"
 //////////////////////////////////////////////////////////////////////
 // Construction/Destruction
 //////////////////////////////////////////////////////////////////////
index 2598857..257f72d 100755 (executable)
@@ -72,7 +72,6 @@
 # pragma comment (lib,"TKernel.lib")
 */
 
-#include <AIS_Drawer.hxx>
 #include <AIS_Circle.hxx>
 #include <AIS_Line.hxx>
 #include <AIS_InteractiveContext.hxx>
 #include <MMgt_TShared.hxx>
 #include <OSD_Environment.hxx>
 #include <Precision.hxx>
+#include <Prs3d_Drawer.hxx>
 #include <Prs3d_LineAspect.hxx>
 #include <Prs3d_PlaneAspect.hxx>
 #include <Prs3d_Presentation.hxx>
index 6e7881e..d567d6e 100755 (executable)
@@ -197,7 +197,7 @@ void CViewer2dDoc::OnBUTTONTestLine()
       TopoDS_Face F = BRepBuilderAPI_MakeFace(W);
       Handle_AIS_Shape aRect = new AIS_Shape(F);
       //set attributes of boundaries
-      Handle(AIS_Drawer) aDrawer = new AIS_Drawer();
+      Handle(Prs3d_Drawer) aDrawer = new Prs3d_Drawer();
       Handle(Prs3d_LineAspect) aLineAttrib = 
         new Prs3d_LineAspect(Quantity_NOC_YELLOW,
         (Aspect_TypeOfLine)(Aspect_TOL_SOLID+j),1);
index 58ad7b7..97a4326 100755 (executable)
@@ -7,7 +7,7 @@
 #include <Prs3d_LineAspect.hxx>
 #include <StdPrs_Curve.hxx>
 #include <GeomAdaptor_Curve.hxx>
-#include <AIS_Drawer.hxx>
+#include <Prs3d_Drawer.hxx>
 #include <Prs3d_ArrowAspect.hxx>
 
 IMPLEMENT_STANDARD_HANDLE(ISession_Curve,AIS_InteractiveObject)
index d49d65f..0abe4a7 100755 (executable)
@@ -17,7 +17,7 @@
 #include <Precision.hxx>
 #include <Geom_Line.hxx>
 #include <Geom_TrimmedCurve.hxx>
-#include <AIS_Drawer.hxx>
+#include <Prs3d_Drawer.hxx>
 #include <Prs3d_ArrowAspect.hxx>
 #include <AIS_Point.hxx>
 #include <Geom_CartesianPoint.hxx>
index 96e806e..debe0e2 100755 (executable)
@@ -41,7 +41,6 @@
 #include <Standard_ShortReal.hxx>
 #pragma warning(  default : 4244 )        // Issue warning 4244
 
-#include <AIS_Drawer.hxx>
 #include <AIS_InteractiveContext.hxx>
 #include <AIS_InteractiveObject.hxx>
 #include <AIS_ListOfInteractive.hxx>
@@ -90,6 +89,7 @@
 #include <MMgt_TShared.hxx>
 #include <OSD_Environment.hxx>
 #include <Precision.hxx>
+#include <Prs3d_Drawer.hxx>
 #include <Prs3d_IsoAspect.hxx>
 #include <Prs3d_LineAspect.hxx>
 #include <Prs3d_Text.hxx>
index 4a8af24..89edb6e 100755 (executable)
@@ -39,7 +39,6 @@
 #include <Standard_ShortReal.hxx>
 #pragma warning(  default : 4244 )        // Issue warning 4244
 
-#include <AIS_Drawer.hxx>
 #include <AIS_InteractiveContext.hxx>
 #include <AIS_InteractiveObject.hxx>
 #include <AIS_Shape.hxx>
@@ -86,6 +85,7 @@
 #include <MMgt_TShared.hxx>
 #include <OSD_Environment.hxx>
 #include <Precision.hxx>
+#include <Prs3d_Drawer.hxx>
 #include <Prs3d_IsoAspect.hxx>
 #include <Prs3d_LineAspect.hxx>
 #include <Prs3d_Projector.hxx>
index 58ad7b7..97a4326 100755 (executable)
@@ -7,7 +7,7 @@
 #include <Prs3d_LineAspect.hxx>
 #include <StdPrs_Curve.hxx>
 #include <GeomAdaptor_Curve.hxx>
-#include <AIS_Drawer.hxx>
+#include <Prs3d_Drawer.hxx>
 #include <Prs3d_ArrowAspect.hxx>
 
 IMPLEMENT_STANDARD_HANDLE(ISession_Curve,AIS_InteractiveObject)
index 3732e01..9ec17d7 100755 (executable)
@@ -18,7 +18,7 @@
 #include <Precision.hxx>
 #include <Geom_Line.hxx>
 #include <Geom_TrimmedCurve.hxx>
-#include <AIS_Drawer.hxx>
+#include <Prs3d_Drawer.hxx>
 #include <Prs3d_ArrowAspect.hxx>
 #include <AIS_Point.hxx>
 #include <Geom_CartesianPoint.hxx>
index f7347b9..540aa5a 100755 (executable)
 # pragma comment (lib,"TKXS214.lib")
 */
  
-#include <AIS_Drawer.hxx>
 #include <AIS_InteractiveContext.hxx>
 #include <AIS_InteractiveObject.hxx>
 #include <AIS_Shape.hxx>
 #include <MMgt_TShared.hxx>
 #include <OSD_Environment.hxx>
 #include <Precision.hxx>
+#include <Prs3d_Drawer.hxx>
 #include <Prs3d_IsoAspect.hxx>
 #include <Prs3d_LineAspect.hxx>
 #include <Prs3d_Text.hxx>
index 4a3b5ed..4e70e4c 100755 (executable)
@@ -117,7 +117,6 @@ enum CurrentAction3d {
 */
 
  
-#include <AIS_Drawer.hxx>
 #include <AIS_InteractiveContext.hxx>
 #include <AIS_InteractiveObject.hxx>
 #include <AIS_Shape.hxx>
@@ -155,6 +154,7 @@ enum CurrentAction3d {
 #include <MMgt_TShared.hxx>
 #include <OSD_Environment.hxx>
 #include <Precision.hxx>
+#include <Prs3d_Drawer.hxx>
 #include <Prs3d_IsoAspect.hxx>
 #include <Prs3d_LineAspect.hxx>
 #include <Prs3d_Text.hxx>
index 58ad7b7..97a4326 100755 (executable)
@@ -7,7 +7,7 @@
 #include <Prs3d_LineAspect.hxx>
 #include <StdPrs_Curve.hxx>
 #include <GeomAdaptor_Curve.hxx>
-#include <AIS_Drawer.hxx>
+#include <Prs3d_Drawer.hxx>
 #include <Prs3d_ArrowAspect.hxx>
 
 IMPLEMENT_STANDARD_HANDLE(ISession_Curve,AIS_InteractiveObject)
index ea8b4d0..89ceabb 100755 (executable)
@@ -17,7 +17,7 @@
 #include <Precision.hxx>
 #include <Geom_Line.hxx>
 #include <Geom_TrimmedCurve.hxx>
-#include <AIS_Drawer.hxx>
+#include <Prs3d_Drawer.hxx>
 #include <Prs3d_ArrowAspect.hxx>
 #include <AIS_Point.hxx>
 #include <Geom_CartesianPoint.hxx>
index a80b1ad..969561b 100755 (executable)
@@ -89,7 +89,7 @@ void CAISNbrIsosDialog::OnDeltaposSpinaisisosv(NMHDR* pNMHDR, LRESULT* pResult)
 
 
 #include <AIS_InteractiveObject.hxx>
-#include <AIS_Drawer.hxx>
+#include <Prs3d_Drawer.hxx>
 
 void CAISNbrIsosDialog::UpdateIsos ()
 {
@@ -99,8 +99,8 @@ void CAISNbrIsosDialog::UpdateIsos ()
             myCurrentIC->MoreCurrent ();
                 myCurrentIC->NextSelected ())
        {       
-               Handle (AIS_InteractiveObject) CurObject;
-               Handle (AIS_Drawer) CurDrawer;
+               Handle(AIS_InteractiveObject) CurObject;
+               Handle(Prs3d_Drawer) CurDrawer;
 
                
                CurObject = myCurrentIC->Current();
index 7b16de8..2415a82 100755 (executable)
@@ -30,7 +30,6 @@
 #include <AIS_InteractiveContext.hxx>
 #include <AIS_Line.hxx>
 #include <AIS_Shape.hxx>
-#include <AIS_Drawer.hxx>
 #include <AIS_Point.hxx>
 #include <AIS_TexturedShape.hxx>
 #include <Aspect_Grid.hxx>
index 657e746..063593d 100644 (file)
@@ -328,8 +328,6 @@ is
     imported ColoredShape;
     imported TexturedShape;
 
-    class Drawer;
-    
     class InteractiveContext;
 
     class GraphicTool;
@@ -681,7 +679,7 @@ is
      
     
     ComputeProjEdgePresentation(aPres    : Presentation from Prs3d; 
-                               aDrawer  : Drawer       from AIS;        
+                               aDrawer  : Drawer       from Prs3d;
                                anEdge   : Edge                 from TopoDS;
                                ProjCurve: Curve                from Geom;
                                FirstP   : Pnt                  from gp;
@@ -692,7 +690,7 @@ is
                                aCallTOL : TypeOfLine           from Aspect   = Aspect_TOL_DOT);
     
     ComputeProjVertexPresentation(aPres    : Presentation from Prs3d; 
-                                 aDrawer  : Drawer       from AIS;        
+                                 aDrawer  : Drawer       from Prs3d;
                                  aVertex  : Vertex               from TopoDS;
                                  ProjPoint: Pnt                  from gp;
                                          aColor   : NameOfColor          from Quantity = Quantity_NOC_PURPLE;
index fe606a7..1886bf0 100644 (file)
@@ -1390,18 +1390,18 @@ gp_Pnt AIS::NearestApex(const gp_Elips & elips,
 //purpose  : 
 //=======================================================================
 
-void AIS::ComputeProjEdgePresentation( const Handle( Prs3d_Presentation )& aPresentation,
-                                      const Handle( AIS_Drawer )& aDrawer,
-                                      const TopoDS_Edge& anEdge,
-                                      const Handle( Geom_Curve )& ProjCurve,
-                                      const gp_Pnt& FirstP,
-                                      const gp_Pnt& LastP,
-                                      const Quantity_NameOfColor aColor,
-                                      const Standard_Real aWidth,
-                                      const Aspect_TypeOfLine aProjTOL,
-                                      const Aspect_TypeOfLine aCallTOL )
+void AIS::ComputeProjEdgePresentation (const Handle(Prs3d_Presentation)& aPresentation,
+                                       const Handle(Prs3d_Drawer)& aDrawer,
+                                       const TopoDS_Edge& anEdge,
+                                       const Handle(Geom_Curve)& ProjCurve,
+                                       const gp_Pnt& FirstP,
+                                       const gp_Pnt& LastP,
+                                       const Quantity_NameOfColor aColor,
+                                       const Standard_Real aWidth,
+                                       const Aspect_TypeOfLine aProjTOL,
+                                       const Aspect_TypeOfLine aCallTOL)
 {
-  if (!aDrawer->HasWireAspect()){
+  if (!aDrawer->HasOwnWireAspect()){
     aDrawer->SetWireAspect(new Prs3d_LineAspect(aColor,aProjTOL,2.));}
   else {
     // CLE
@@ -1493,16 +1493,16 @@ void AIS::ComputeProjEdgePresentation( const Handle( Prs3d_Presentation )& aPres
 //purpose  : 
 //=======================================================================
 
-void AIS::ComputeProjVertexPresentationconst Handle( Prs3d_Presentation )& aPresentation,
-                                       const Handle( AIS_Drawer )& aDrawer,
-                                       const TopoDS_Vertex& aVertex,
-                                       const gp_Pnt& ProjPoint,
-                                       const Quantity_NameOfColor aColor,
-                                       const Standard_Real aWidth,
-                                       const Aspect_TypeOfMarker aProjTOM,
-                                       const Aspect_TypeOfLine aCallTOL ) 
+void AIS::ComputeProjVertexPresentation (const Handle( Prs3d_Presentation )& aPresentation,
+                                         const Handle( Prs3d_Drawer )& aDrawer,
+                                         const TopoDS_Vertex& aVertex,
+                                         const gp_Pnt& ProjPoint,
+                                         const Quantity_NameOfColor aColor,
+                                         const Standard_Real aWidth,
+                                         const Aspect_TypeOfMarker aProjTOM,
+                                         const Aspect_TypeOfLine aCallTOL)
 {
-  if (!aDrawer->HasPointAspect()){
+  if (!aDrawer->HasOwnPointAspect()){
     aDrawer->SetPointAspect(new Prs3d_PointAspect(aProjTOM, aColor,1));}
   else {
     // CLE
@@ -1516,7 +1516,7 @@ void AIS::ComputeProjVertexPresentation( const Handle( Prs3d_Presentation )& aPr
   // calculate the projection
   StdPrs_Point::Add(aPresentation, new Geom_CartesianPoint(ProjPoint), aDrawer);
 
-  if (!aDrawer->HasWireAspect()){
+  if (!aDrawer->HasOwnWireAspect()){
     aDrawer->SetWireAspect(new Prs3d_LineAspect(aColor,aCallTOL,2.));}
   else {
     // CLE
index 5f543d0..2767e03 100644 (file)
@@ -17,7 +17,6 @@
 #include <AIS_AngleDimension.hxx>
 
 #include <AIS.hxx>
-#include <AIS_Drawer.hxx>
 #include <BRepBuilderAPI_MakeFace.hxx>
 #include <BRepAdaptor_Curve.hxx>
 #include <BRepAdaptor_Surface.hxx>
index b35d701..9202253 100644 (file)
@@ -32,7 +32,6 @@
 #include <gp_Ax2.hxx>
 #include <Geom_Line.hxx>
 #include <GeomAdaptor_Curve.hxx>
-#include <AIS_Drawer.hxx>
 #include <DsgPrs_XYZAxisPresentation.hxx>
 #include <UnitsAPI.hxx>
 
index 1b69a80..4a36258 100644 (file)
@@ -52,7 +52,6 @@
 #include <BRepTools_WireExplorer.hxx>
 
 #include <AIS.hxx>
-#include <AIS_Drawer.hxx>
 
 #include <BRepAdaptor_Surface.hxx>
 #include <ProjLib.hxx>
index 9df9e61..0405edc 100644 (file)
@@ -52,7 +52,6 @@
 #include <BRepTools_WireExplorer.hxx>
 
 #include <AIS.hxx>
-#include <AIS_Drawer.hxx>
 
 #include <BRepAdaptor_Surface.hxx>
 #include <ProjLib.hxx>
index 1bc4635..f7c4ac3 100644 (file)
@@ -27,7 +27,6 @@
 #include <TopoDS.hxx>
 #include <Geom_Circle.hxx>
 #include <GeomAdaptor_Curve.hxx>
-#include <AIS_Drawer.hxx>
 #include <GC_MakeArcOfCircle.hxx>
 #include <Quantity_Color.hxx>
 #include <AIS_GraphicTool.hxx>
@@ -128,10 +127,12 @@ void AIS_Circle::SetColor(const Quantity_Color &aCol)
   hasOwnColor=Standard_True;
   myOwnColor=aCol;
 
-  Standard_Real WW = HasWidth()? myOwnWidth:
-                                 AIS_GraphicTool::GetLineWidth(myDrawer->Link(),AIS_TOA_Line);
+  Standard_Real WW = HasWidth() ? myOwnWidth :
+                                  myDrawer->HasLink() ?
+                                  AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line) :
+                                  1.;
 
-  if (!myDrawer->HasLineAspect ())
+  if (!myDrawer->HasOwnLineAspect ())
     myDrawer->SetLineAspect (new Prs3d_LineAspect(aCol,Aspect_TOL_SOLID,WW));
   else
     myDrawer->LineAspect()->SetColor(aCol);
@@ -147,10 +148,10 @@ void AIS_Circle::SetWidth(const Standard_Real aValue)
 {
   myOwnWidth=aValue;
 
-  if (!myDrawer->HasLineAspect ()) {
-    Quantity_Color CC;
+  if (!myDrawer->HasOwnLineAspect ()) {
+    Quantity_Color CC = Quantity_NOC_YELLOW;
     if( HasColor() ) CC = myOwnColor;
-    else AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
+    else if(myDrawer->HasLink()) AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Line, CC);
     myDrawer->SetLineAspect (new Prs3d_LineAspect(CC,Aspect_TOL_SOLID,aValue));
   } else
     myDrawer->LineAspect()->SetWidth(aValue);
@@ -169,9 +170,9 @@ void AIS_Circle::UnsetColor()
 
   if (!HasWidth()) myDrawer->SetLineAspect(NullAsp);
   else{
-    Quantity_Color CC;
+    Quantity_Color CC = Quantity_NOC_YELLOW;;
     if( HasColor() ) CC = myOwnColor;
-    else AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
+    else if (myDrawer->HasLink()) AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
     myDrawer->LineAspect()->SetColor(CC);
     myOwnColor = CC;
   }
@@ -187,7 +188,7 @@ void AIS_Circle::UnsetWidth()
 
   if (!HasColor()) myDrawer->SetLineAspect(NullAsp);
   else{
-   Standard_Real WW = AIS_GraphicTool::GetLineWidth(myDrawer->Link(),AIS_TOA_Line);
+   Standard_Real WW = myDrawer->HasLink() ? AIS_GraphicTool::GetLineWidth(myDrawer->Link(),AIS_TOA_Line) : 1.;
    myDrawer->LineAspect()->SetWidth(WW);
    myOwnWidth = WW;
   }
index de89c42..7e31948 100644 (file)
@@ -25,6 +25,7 @@
 #include <Graphic3d_StructureManager.hxx>
 #include <Graphic3d_Texture2Dmanual.hxx>
 #include <Precision.hxx>
+#include <Prs3d.hxx>
 #include <Prs3d_LineAspect.hxx>
 #include <Prs3d_IsoAspect.hxx>
 #include <Prs3d_Presentation.hxx>
@@ -41,8 +42,8 @@
 #include <TopoDS_Compound.hxx>
 #include <TopoDS_Iterator.hxx>
 
-IMPLEMENT_STANDARD_HANDLE (AIS_ColoredDrawer, AIS_Drawer)
-IMPLEMENT_STANDARD_RTTIEXT(AIS_ColoredDrawer, AIS_Drawer)
+IMPLEMENT_STANDARD_HANDLE (AIS_ColoredDrawer, Prs3d_Drawer)
+IMPLEMENT_STANDARD_RTTIEXT(AIS_ColoredDrawer, Prs3d_Drawer)
 
 IMPLEMENT_STANDARD_HANDLE (AIS_ColoredShape, AIS_Shape)
 IMPLEMENT_STANDARD_RTTIEXT(AIS_ColoredShape, AIS_Shape)
@@ -203,15 +204,15 @@ void AIS_ColoredShape::SetColor (const Quantity_Color&  theColor)
       continue;
     }
 
-    if (aDrawer->HasShadingAspect())
+    if (aDrawer->HasOwnShadingAspect())
     {
       aDrawer->ShadingAspect()->SetColor (theColor, myCurrentFacingModel);
     }
-    if (aDrawer->HasLineAspect())
+    if (aDrawer->HasOwnLineAspect())
     {
       aDrawer->LineAspect()->SetColor (theColor);
     }
-    if (aDrawer->HasWireAspect())
+    if (aDrawer->HasOwnWireAspect())
     {
       aDrawer->WireAspect()->SetColor (theColor);
     }
@@ -237,11 +238,11 @@ void AIS_ColoredShape::SetWidth (const Standard_Real    theLineWidth)
       continue;
     }
 
-    if (aDrawer->HasLineAspect())
+    if (aDrawer->HasOwnLineAspect())
     {
       aDrawer->LineAspect()->SetWidth (theLineWidth);
     }
-    if (aDrawer->HasWireAspect())
+    if (aDrawer->HasOwnWireAspect())
     {
       aDrawer->WireAspect()->SetWidth (theLineWidth);
     }
@@ -261,8 +262,8 @@ void AIS_ColoredShape::SetTransparency (const Standard_Real theValue)
   LoadRecomputable (AIS_Shaded);
   for (DataMapOfShapeColor::Iterator anIter (myShapeColors); anIter.More(); anIter.Next())
   {
-    const Handle(AIS_Drawer)& aDrawer = anIter.Value();
-    if (aDrawer->HasShadingAspect())
+    const Handle(Prs3d_Drawer)& aDrawer = anIter.Value();
+    if (aDrawer->HasOwnShadingAspect())
     {
       aDrawer->ShadingAspect()->SetTransparency (theValue, myCurrentFacingModel);
     }
@@ -284,7 +285,7 @@ void AIS_ColoredShape::SetMaterial (const Graphic3d_MaterialAspect& theMaterial)
   {
     const Handle(AIS_ColoredDrawer)& aDrawer = anIter.Value();
     //if (aDrawer->HasOwnMaterial()) continue;
-    if (aDrawer->HasShadingAspect())
+    if (aDrawer->HasOwnShadingAspect())
     {
       setMaterial (aDrawer, theMaterial, aDrawer->HasOwnColor(), Standard_False); // aDrawer->IsTransparent()
     }
@@ -377,7 +378,7 @@ void AIS_ColoredShape::addShapesWithCustomProps (const Handle(Prs3d_Presentation
     {
       const TopoDS_Shape&    aShapeKey  = aMapIter.Key();   // key shape with detailed color or a base shape
       const TopoDS_Compound& aShapeDraw = aMapIter.Value(); // compound of subshapes with <aShType> type
-      Handle(AIS_Drawer)     aDrawer;
+      Handle(Prs3d_Drawer) aDrawer;
       if (myShapeColors.Find (aShapeKey, aCustomDrawer))
       {
         aDrawer = aCustomDrawer;
index 0830004..5fb4a3e 100644 (file)
@@ -16,7 +16,7 @@
 #ifndef _AIS_ColoredShape_HeaderFile
 #define _AIS_ColoredShape_HeaderFile
 
-#include <AIS_Drawer.hxx>
+#include <Prs3d_Drawer.hxx>
 #include <AIS_Shape.hxx>
 
 #include <NCollection_DataMap.hxx>
 #include <StdPrs_Volume.hxx>
 
 //! Customizable properties.
-class AIS_ColoredDrawer : public AIS_Drawer
+class AIS_ColoredDrawer : public Prs3d_Drawer
 {
 public:
 
-  AIS_ColoredDrawer (const Handle(AIS_Drawer)& theLink)
+  AIS_ColoredDrawer (const Handle(Prs3d_Drawer)& theLink)
   : myIsHidden    (Standard_False),
     myHasOwnColor (Standard_False),
     myHasOwnWidth (Standard_False)
@@ -58,7 +58,7 @@ public:
 
 };
 
-DEFINE_STANDARD_HANDLE(AIS_ColoredDrawer, AIS_Drawer)
+DEFINE_STANDARD_HANDLE(AIS_ColoredDrawer, Prs3d_Drawer)
 
 //! Presentation of the shape with customizable sub-shapes properties.
 class AIS_ColoredShape : public AIS_Shape
index 74c2dc8..10a7368 100644 (file)
@@ -33,7 +33,6 @@
 #include <AIS_InteractiveContext.hxx>
 #include <BRepTools.hxx>
 #include <Precision.hxx>
-#include <AIS_Drawer.hxx>
 #include <TopAbs_ShapeEnum.hxx>
 #include <Standard_ProgramError.hxx>
 #include <StdPrs_WFDeflectionShape.hxx>
index a71e552..03ad7d0 100755 (executable)
 #include <AIS_KindOfInteractive.hxx>
 #include <AIS_KindOfDimension.hxx>
 #include <AIS_KindOfSurface.hxx>
-#include <AIS_Drawer.hxx>
 #include <Geom_Curve.hxx>
 #include <gp_Pln.hxx>
 #include <Prs3d_ArrowAspect.hxx>
 #include <Prs3d_DimensionAspect.hxx>
 #include <Prs3d_DimensionUnits.hxx>
+#include <Prs3d_Drawer.hxx>
 #include <Prs3d_LineAspect.hxx>
 #include <Prs3d_Presentation.hxx>
 #include <Prs3d_TextAspect.hxx>
diff --git a/src/AIS/AIS_Drawer.cdl b/src/AIS/AIS_Drawer.cdl
deleted file mode 100644 (file)
index bda1a86..0000000
+++ /dev/null
@@ -1,682 +0,0 @@
--- Created on: 1992-09-18
--- Created by: Odile Olivier
--- Copyright (c) 1992-1999 Matra Datavision
--- Copyright (c) 1999-2014 OPEN CASCADE SAS
---
--- This file is part of Open CASCADE Technology software library.
---
--- This library is free software; you can redistribute it and/or modify it under
--- the terms of the GNU Lesser General Public License version 2.1 as published
--- by the Free Software Foundation, with special exception defined in the file
--- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
--- distribution for complete text of the license and disclaimer of any warranty.
---
--- Alternatively, this file may be used under the terms of Open CASCADE
--- commercial license or contractual agreement.
-
-class Drawer from AIS inherits Drawer from Prs3d
-
-       ---Purpose: 
-       -- A framework to manage display attributes of interactive objects.
-       -- An interactive object can have a certain number of
-       -- display attributes specific to it. These include
-       -- visualization mode, color, material
-       -- and so on. To deal with this information, the
-       -- interactive context has a Drawer attribute manager
-       -- which is valid by default for the objects it
-       -- controls.   When an interactive object is visualized, the
-       -- required graphic display attributes are first taken from
-       -- its own Drawer if it has the ones required, or from the
-       -- context drawer for those it does not have them.
-       -- The set of display attributes of an interactive object is
-       -- stocked in an AIS_Drawer, which is, in fact, a
-       -- Prs3d_Drawer with the possibility of a link to another
-       -- display attribute manager. This drawer then manages
-       -- the stocked graphic display attributes by specifying
-       -- how the presentation algorithms compute the
-       -- presentation of a specific kind of object. These
-       -- factors involved include color, width and type of line,
-       -- and maximal chordal deviation. The Drawer includes
-       -- instances of the aspect classes providing the default
-       -- values for them.
-       -- Prs3d_Drawer completes   AIS_Drawer by adding
-       -- functions for setting deviation angle and deviation
-       -- coefficient in presentations using hidden line removal.
-        
-uses
-    Drawer from Prs3d,
-    DatumAspect from Prs3d,
-    LineAspect from Prs3d,
-    TextAspect from Prs3d,
-    PointAspect from Prs3d,
-    ShadingAspect from Prs3d,
-    IsoAspect from Prs3d,
-    DimensionAspect from Prs3d,
-    PlaneAspect from Prs3d,
-    ArrowAspect from Prs3d,
-    TypeOfDeflection from Aspect,
-    NameOfColor from Quantity,
-    PlaneAngle from Quantity,
-    Length from Quantity,
-    DimensionUnits from Prs3d,
-    VertexDrawMode from Prs3d,
-    AsciiString from TCollection,
-    TypeOfHLR from Prs3d,
-    Ax2 from gp
-
-is
-    Create returns Drawer from AIS;
-        ---Purpose:
-        -- Constructs an empty attribute management framework.   
-    TypeOfDeflection(me) returns TypeOfDeflection from Aspect
-    is redefined static;
-        --- Purpose:
-        -- Returns the type of chordal deflection: relative to the
-        -- size of the object or absolute.  
-    
-    MaximalChordialDeviation (me) returns Length from Quantity
-        ---Purpose: Returns the maximal chordal deviation. The default
-        -- value is 0.1. Drawings of curves or patches are
-        -- made with respect to an absolute maximal chordal deviation.
-    is redefined static;
-           
-
-------------------------------------------------------------                                                               
-    SetDeviationCoefficient(me: mutable) ;
-        ---Purpose: Sets the hasOwnDeviationCoefficient flag to Standard_False 
-        ---C++: inline
-
-    SetHLRDeviationCoefficient(me: mutable) ;
-        ---Purpose: Sets the deviation coefficient aCoefficient for
-        -- removal of hidden lines created by different
-        -- viewpoints in different presentations. The Default value is 0.02.
-        ---C++: inline
-         
-    SetDeviationAngle(me: mutable) ;
-        ---Purpose: Sets the hasOwnDeviationAngle flag to Standard_False 
-        ---C++: inline
-
-    SetHLRAngle(me: mutable) ;
-        ---Purpose: Sets the angle of maximum chordal deviation for
-        -- removal of hidden lines created by different viewpoints 
-        -- in different presentations. The default value is 20*PI/180.
-        ---C++: inline
-                   
-    SetDeviationCoefficient(me: mutable; aCoefficient: Real from Standard )   
-        ---Purpose: Sets the hasOwnDeviationCoefficient flag to Standard_True,
-        --          sets myOwnDeviationCoefficient and  myPreviousDeviationCoefficient
-    is redefined static;
-    
-    SetHLRDeviationCoefficient(me: mutable; aCoefficient: Real from Standard )   
-        ---Purpose: Sets the hasOwnHLRDeviationCoefficient flag to Standard_True,
-        --          sets myOwnHLRDeviationCoefficient and  myPreviousHLRDeviationCoefficient
-    is redefined static;
-        
-    SetDeviationAngle(me: mutable; anAngle: Real from Standard )  is redefined ;
-        ---Purpose: Sets the hasOwnDeviationAngle flag to Standard_True,
-        --          sets myOwnDeviationAngle and  myPreviousDeviationAngle
-       
-    SetHLRAngle(me: mutable; anAngle: Real from Standard )   
-        ---Purpose: Sets the hasOwnHLRDeviationAngle flag to Standard_True,
-        --          sets myOwnHLRDeviationAngle and  myPreviousHLRDeviationAngle
-    is redefined static;
-
-    SetTypeOfHLR(me: mutable; theTypeOfHLR: TypeOfHLR from Prs3d)
-    is redefined;
-    ---Purpose: Sets the type of HLR algorithm
-    --          used by drawer's interactive objects
-    ---C++: inline
-    
-    TypeOfHLR(me) returns TypeOfHLR from Prs3d
-    is redefined;
-    ---Purpose: Returns the type of HLR algorithm currently in use.
-    ---C++: inline
-
-    DeviationCoefficient(me) returns Real from Standard
-        ---Purpose: Drawings of curves or patches are made with respect
-        -- to a maximal chordal deviation. A Deviation coefficient
-        -- is used in the shading display mode. The shape is
-        -- seen decomposed into triangles. These are used to
-        -- calculate reflection of light from the surface of the
-        -- object. The triangles are formed from chords of the
-        -- curves in the shape. The deviation coefficient gives
-        -- the highest value of the angle with which a chord can
-        -- deviate from a tangent to a   curve. If this limit is
-        -- reached, a new triangle is begun.
-        -- This deviation is absolute and is set through the
-        -- method: SetMaximalChordialDeviation. The default value is 0.001.
-        -- In drawing shapes, however, you are allowed to ask
-        -- for a relative deviation. This deviation will be:
-        -- SizeOfObject * DeviationCoefficient.
-    is redefined static;
-    
-    HLRDeviationCoefficient(me) returns Real from Standard
-        ---Purpose: Returns the real number value of the HLR deviation
-       -- coefficient in this framework, if the flag
-       -- hasOwnHLRDeviationCoefficient is true.
-       -- If hasOwnHLRDeviationCoefficient is false, the
-       -- shape's HLR deviation coefficient is used.
-       -- A Deviation coefficient is used in the shading display
-       -- mode. The shape is seen decomposed into triangles.
-       -- These are used to calculate reflection of light from the
-       -- surface of the object.
-       -- The triangles are formed from chords of the curves in
-       -- the shape. The deviation coefficient give the highest
-       -- value of the angle with which a chord can deviate
-       -- from a tangent to a curve. If this limit is reached, a
-       -- new triangle is begun.
-       -- To find the hidden lines, hidden line display mode
-       -- entails recalculation of the view at each different
-       -- projector perspective.
-       -- Since hidden lines entail calculations of more than
-       -- usual complexity to decompose them into these
-       -- triangles, a deviation coefficient allowing greater
-       -- tolerance is used. This increases efficiency in calculation.
-       -- The Default value is 0.02.
-    is redefined static;   
-    
-    
-    DeviationAngle(me) returns Real from Standard
-       ---Purpose: Returns myOwnDeviationAngle if hasOwnDeviationAngle is True
-       --          else gets myDeviationAngle field from Prs3d_Drawer 
-    is redefined;
-               
-    HLRAngle(me) returns Real from Standard
-       ---Purpose: Returns the real number value of the deviation angle
-       -- in hidden line removal views. The default value is 20*PI/180.
-        is redefined static;              
-    
-    
-    PreviousDeviationCoefficient(me) returns Real from Standard
-       ---Purpose: Saves the previous value used for the chordal
-       -- deviation coefficient. The default value is 0.1.
-       ---C++: inline
-    is static;          
-  
-    PreviousHLRDeviationCoefficient(me) returns Real from Standard
-       ---Purpose: returns myPreviousHLRDeviationCoefficient
-       ---C++: inline
-    is static;
-
-    PreviousDeviationAngle(me) returns Real from Standard
-       ---Purpose: returns myPreviousDeviationAngle
-       ---C++: inline
-    is  static;
-
-    PreviousHLRDeviationAngle(me) returns Real from Standard
-       ---Purpose: returns myPreviousHLRDeviationAngle
-       ---C++: inline 
-    is  static;
-    
-    IsOwnDeviationCoefficient(me) returns Boolean from Standard;
-       ---Purpose: Returns true if the there is a local setting for deviation
-       -- coefficient in this framework for a specific interactive object.
-        ---C++: inline
-             
-    IsOwnHLRDeviationCoefficient(me) returns Boolean from Standard;
-       ---Purpose: Returns true if the there is a setting for HLR deviation
-       -- coefficient in this framework for a specific interactive object.
-        ---C++: inline
-                                                              
-    IsOwnDeviationAngle(me) returns Boolean from Standard;
-       ---Purpose: Returns true if the there is a local setting for deviation
-       -- angle in this framework for a specific interactive object.
-        ---C++: inline
-
-    IsOwnHLRDeviationAngle(me) returns Boolean from Standard;
-       ---Purpose: Returns true if the there is a setting for HLR deviation
-       -- angle in this framework for a specific interactive object.
-       ---C++: inline
-
-    Discretisation(me) returns Integer from Standard
-    is redefined static;
-       ---Purpose: Draws algorithms using discretisation, a default
-       -- number of points has been set to 17. You can use the
-       -- method Prs3d_Drawer_SetDiscretisation to change this value. 
-    
-    MaximalParameterValue(me) returns Real from Standard
-    is redefined static;
-       ---Purpose:
-       -- Sets the maximum value allowed for the first and last
-       -- parameters of an infinite curve. By default, this value is 500000.
-    
-    IsoOnPlane(me) returns Boolean from Standard 
-       ---Purpose: returns True if the drawing of isos on planes is enabled.
-    is redefined static;
-
-
--- 
--- Attributes for the U Isoparametric lines of patches.
---    
-    UIsoAspect (me:mutable) returns IsoAspect from Prs3d
-        ---Purpose: 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
-        -- These attributes are used by the following algorithms:
-        --          Prs3d_WFDeflectionSurface 
-        --          Prs3d_WFDeflectionRestrictedFace
-
-
-    is redefined static;    
-    
-    HasUIsoAspect (me) returns Boolean from Standard 
-        ---Purpose: Returns true if the Drawer has a UIso aspect setting active.
-        ---C++: inline
-   is static;
-
--- Attributes for the V Isoparametric line of patches.
-
-
-    VIsoAspect (me:mutable) returns IsoAspect from Prs3d
-        ---Purpose: 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
-        --          These attributes are used by the following algorithms:
-        --          Prs3d_WFDeflectionSurface 
-        --          Prs3d_WFDeflectionRestrictedFace
-    is redefined static;    
-
-    HasVIsoAspect (me) returns Boolean from Standard 
-        ---Purpose: Returns true if the Drawer has a VIso aspect setting active.
-        ---C++: inline
-   is static;    
-
--- Attributes for the free boundaries
-
-    FreeBoundaryAspect (me:mutable) returns LineAspect from Prs3d
-        ---Purpose: Returns a link with
-        -- Prs3d_Drawer_FreeBoundaryAspect. Stores 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.
-        -- These attributes are used by Prs3d_WFShape.
-    is redefined static;
-
-    HasFreeBoundaryAspect (me) returns Boolean from Standard
-    ---Purpose: Returns true if the Drawer has a free boundary aspect setting active.
-    ---C++: inline
-    is static;
-
-    FreeBoundaryDraw(me) returns Boolean from Standard 
-        ---Purpose: returns True if the drawing of the free boundaries is enabled.
-    is redefined static;
-    
-
--- Attributes for the wires
-
-    WireAspect (me:mutable) returns LineAspect from Prs3d
-        ---Purpose: Returns a link with Prs3d_Drawer_WireAspect.
-        -- This method provides wire aspect settings.
-        -- The LineAspect for wires can be edited. The default values are:
-        --          Color: Quantity_NOC_RED
-        --          Type of line: Aspect_TOL_SOLID
-        --          Width: 1.
-        --          These attributes are used by the following algorithms:
-        --          Prs3d_WFShape
-    is redefined static;    
-
-    HasLineAspect (me) returns Boolean from Standard 
-        ---Purpose: Returns true if the Interactive Object has a line
-        -- visualization aspect.
-        ---C++: inline 
-  is static;      
-
-    HasWireAspect (me) returns Boolean from Standard 
-        ---Purpose: Returns true if the Drawer has a wire aspect setting active.
-        ---C++: inline 
-    is static;      
-
-    WireDraw(me) returns Boolean from Standard 
-        ---Purpose: Returns a link   with Prs3d_Drawer_WireDraw. This
-        -- method returns true if drawing of wires is enabled.
-        -- The default setting is true.
-    is redefined static;
-    
-
--- Attributes for the unfree boundaries
-
-    UnFreeBoundaryAspect (me:mutable) returns LineAspect from Prs3d
-        ---Purpose: Returns a link with
-        -- Prs3d_Drawer_UnFreeBoundaryAspect, which
-        -- provides settings for shared boundary line aspects.
-        -- The LineAspect for shared 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 following algorithms:
-        --          Prs3d_WFShape
-    is redefined static;
-
-    HasUnFreeBoundaryAspect (me) returns Boolean from Standard
-    ---Purpose: Returns true if the Drawer has an unfree boundary aspect setting active.
-    ---C++: inline
-    is static;
-
-    UnFreeBoundaryDraw(me) returns Boolean from Standard 
-        ---Purpose: Returns True if the drawing of the shared boundaries
-        -- is enabled. True is the default setting.
-    is redefined static;
-    
-
--- 
---  Attributes for the lines.
--- 
-
-    LineAspect(me:mutable) returns LineAspect from Prs3d
-       ---Purpose:  Returns a link with Prs3d_Drawer_LineAspect,
-       -- which provides 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.
-       -- These attributes are used by the following algorithms:
-       --          Prs3d_Curve
-       --          Prs3d_Line
-       --          Prs3d_HLRShape
-
-    is redefined static;
-    
-  
-
-    HasTextAspect(me) returns Boolean from Standard
-    is static;      
-       ---C++: inline     
-    TextAspect(me:mutable) returns TextAspect from Prs3d
-    --          
-    --          Color: Quantity_NOC_YELLOW
-    is redefined static;                           
-
-    LineArrowDraw(me) returns Boolean from Standard 
-       ---Purpose: Returns True if the drawing of an arrow at the end of
-       -- each line is enabled. The default setting is False.
-    is redefined static;
-    
-    ArrowAspect(me:mutable) returns ArrowAspect from Prs3d 
-    is redefined static;
-    
-    
--- -- 
---  Attributes for the points
--- 
-    PointAspect(me:mutable) returns PointAspect from Prs3d
-       ---Purpose:  Returns the point aspect setting. The default values
-       -- are:        Color: Quantity_NOC_YELLOW
-       --          Type of marker: Aspect_TOM_PLUS
-       --          Scale: 1.
-       --          These attributes are used by the following algorithms:
-       --          Prs3d_Point
-    is redefined static;
-
-    HasPointAspect (me) returns Boolean from Standard 
-       ---Purpose: Returns true if the Drawer has a point aspect setting active. 
-    is static;      
-       ---C++: inline
-
-    SetVertexDrawMode(me: mutable; theMode: VertexDrawMode from Prs3d)
-      ---Purpose: Sets the mode of visualization of vertices by AIS_Shape and helper algorithms.
-      -- By default, only isolated vertices not belonging to any face are drawn,
-      -- that corresponds to <b>Prs3d_VDM_Isolated</b> mode.
-      -- Switching to <b>Prs3d_VDM_Isolated</b> mode makes all shape's vertices visible.
-      -- To inherit this parameter from the global drawer instance ("the link") when it is present,
-      -- <b>Prs3d_VDM_Inherited</b> value should be used.
-    is redefined static;
-
-    VertexDrawMode(me) returns VertexDrawMode from Prs3d
-      ---Purpose: Returns the current mode of visualization of vertices of a TopoDS_Shape instance.
-    is redefined static;
-    
-    IsOwnVertexDrawMode(me) returns Boolean from Standard;
-      ---Purpose: 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.
-      ---C++: inline
-
---  Attributes for the faces:
---  
-    ShadingAspect (me:mutable) returns ShadingAspect from Prs3d
-       ---Purpose:
-       -- Returns a link with Prs3d_Drawer_ShadingAspect,
-       -- which provides settings for shading aspects.
-       -- These settings can be edited. The default values are:
-       --    Color: Quantity_NOC_YELLOW
-       --          Material: Graphic3d_NOM_BRASS
-       -- hading 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.
-    is redefined static;
-
-    HasShadingAspect (me) returns Boolean from Standard 
-        ---C++: inline 
-       ---Purpose: Returns True if the   Drawer has shading aspect active.
-    is static;      
-        
-    ShadingAspectGlobal(me) returns Boolean from Standard
-    is redefined static;  
-       ---Purpose: Provides the attributes for hidden line removal.
-
-
-    DrawHiddenLine(me) returns Boolean from Standard 
-       ---Purpose: Returns Standard_True if the hidden lines are to be drawn.
-       --          By default the hidden lines are not drawn.
-    is redefined static;
-    
-    HiddenLineAspect(me:mutable) returns LineAspect from Prs3d
-       ---Purpose: Returns a link with
-       -- Prs3d_Drawer_HiddenLineAspect, which provides
-       -- 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.
-    is redefined static;
-
-    
-    SeenLineAspect(me:mutable) returns LineAspect from Prs3d
-       ---Purpose: Returns a link with
-       -- Prs3d_Drawer_SeenLineAspect, which provides
-       -- 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.
-    is redefined static;
-    
-  
-    HasPlaneAspect(me) returns Boolean from Standard;
-       ---C++: inline
-
-    PlaneAspect(me:mutable) returns PlaneAspect from Prs3d
-    is redefined static;
-       ---Purpose:
-       -- Returns a link with Prs3d_Drawer_PlaneAspect.
-       -- This method provides settings for the appearance of planes.
-
-
-    VectorAspect(me:mutable) returns LineAspect from Prs3d
-       ---Purpose: Returns a link with Prs3d_Drawer_VectorAspect,
-       -- which provides 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.
-    is redefined static;
-    
-    SetFaceBoundaryDraw (me           : mutable;
-                         theIsEnabled : Boolean from Standard)
-    is redefined static;
-        ---Purpose: Enables or disables drawing of face boundaries for shading presentations.
-        -- The method sets drawing flag owned by the drawer that will be used during
-        -- visualization instead of the one set in link.
-        -- theIsEnabled is a boolean flag indicating whether the face boundaries should be
-        -- drawn or not.
-
-    IsFaceBoundaryDraw (me) returns Boolean from Standard
-    is redefined static;
-        ---Purpose: Checks whether the drawing of face boundaries is enabled or not.
-
-    SetFaceBoundaryAspect (me        : mutable;
-                           theAspect : LineAspect from Prs3d)
-    is redefined static;
-        ---Purpose: Sets line aspect for face boundaries.
-        -- 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.
-
-    FaceBoundaryAspect (me : mutable) returns LineAspect from Prs3d
-    is redefined static;
-        ---Purpose: Returns line aspect of face boundaries.
-
-    IsOwnFaceBoundaryDraw (me) returns Boolean from Standard
-    is static;
-        ---Purpose: Returns true if the drawer has its own attribute for 
-        -- "draw face boundaries" flag that overrides the one in the link.
-        ---C++: inline
-
-    IsOwnFaceBoundaryAspect (me) returns Boolean from Standard
-    is static;
-        ---Purpose: Returns true if the drawer has its own attribute for 
-        -- face boundaries aspect that overrides the one in the link.
-        ---C++: inline
---
---  Attributes for the presentation of a Datum.
---  
-
-    HasDatumAspect(me) returns Boolean from Standard;
-       ---C++: inline 
-
-    DatumAspect(me:mutable) returns DatumAspect from Prs3d
-       ---Purpose: Returns a link with Prs3d_Drawer_DatumAspect,
-       -- which provides 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.
-    is redefined static;
-
---
---  Attributes for the presentation of a dimensions.
---  
-
-    DimensionAspect (me : mutable) returns DimensionAspect from Prs3d is redefined static;
-    ---Purpose: Returns a link with Prs3d_Drawer_DimensionAspect,
-    -- which provides settings for the appearance of dimensions.
-
-    HasDimensionAspect (me) returns Boolean from Standard is static;
-    ---C++: inline
-    -- Purpose: Returns true if the Drawer has a dimension aspect setting active.
-
-    SetDimLengthModelUnits (me: mutable; theUnits : AsciiString from TCollection) is redefined static;
-    ---Purpose: Sets dimension length model units for computing of dimension presentation.
-
-    SetDimAngleModelUnits (me: mutable; theUnits : AsciiString from TCollection) is redefined static;
-    ---Purpose: Sets dimension angle model units for computing of dimension presentation.
-
-    DimAngleModelUnits (me) returns AsciiString from TCollection is redefined static;
-    ---Purpose: Returns angle model units for the dimension presentation.
-    ---C++: return const &
-
-    DimLengthModelUnits (me) returns AsciiString from TCollection is redefined static;
-    ---Purpose: Returns length model units for the dimension presentation.
-    ---C++: return const &
-
-    SetDimLengthDisplayUnits (me: mutable; theUnits : AsciiString from TCollection) is redefined static;
-    ---Purpose: Sets length units in which value for dimension presentation is displayed.
-
-    SetDimAngleDisplayUnits (me: mutable; theUnits : AsciiString from TCollection) is redefined static;
-    ---Purpose: Sets angle units in which value for dimension presentation is displayed.
-
-    DimLengthDisplayUnits (me) returns AsciiString from TCollection is redefined static;
-    ---Purpose: Returns length units in which dimension presentation is displayed.
-    ---C++: return const &
-
-    DimAngleDisplayUnits (me) returns AsciiString from TCollection is redefined static;
-    ---Purpose: Returns angle units in which dimension presentation is displayed.
-    ---C++: return const &
-
--- Attributes for the sections
-
-    SectionAspect (me:mutable) returns LineAspect from Prs3d
-       ---Purpose: Returns a link with Prs3d_Drawer_SectionAspect,
-       -- which provides settings for wires which highlight sections.
-       -- The LineAspect for the wire can be edited.
-       -- The default values are:
-       -- Color: Quantity_NOC_ORANGE
-       -- Type of line: Aspect_TOL_SOLID
-       -- Width: 1.
-       -- These attributes are used by the following algorithms:
-       -- Prs3d_WFShape
-    is redefined static;    
-
-    Link(me:mutable) returns any Drawer from Prs3d
-    is static;
-       ---C++: return const&
-
-    HasLink(me) returns Boolean from Standard
-    is static;
-       ---C++: inline
-
-    Link (me:mutable; aDrawer: Drawer from Prs3d)     
-    is static;
-       ---C++: inline
-
-    
-    ClearLocalAttributes(me:mutable) is virtual;    
-       ---Purpose: Removes attributes stored in a Local Context.    
-    
-    WasLastLocal(me) returns Boolean from Standard;
-        ---C++: inline
-       ---Purpose: Returns true if the last called attribute was local; false if it was global.
-    
-    HasLocalAttributes(me) returns Boolean from Standard;
-        ---C++: inline
-       ---Purpose:
-       -- Returns true if a Local Context has stored attributes
-       -- for Interactive Objects.
-
-fields
-
-    myLink                           : Drawer from Prs3d;
-    hasLocalAttributes               : Boolean from Standard;          
-
-    myhasOwnDeviationCoefficient     : Boolean from Standard;
-    myOwnDeviationCoefficient        : Real from Standard;
-    myPreviousDeviationCoefficient   : Real from Standard;
-
-    myhasOwnHLRDeviationCoefficient  : Boolean from Standard;
-    myOwnHLRDeviationCoefficient     : Real from Standard;
-    myPreviousHLRDeviationCoefficient: Real from Standard;
-
-    myhasOwnDeviationAngle           : Boolean from Standard;
-    myOwnDeviationAngle              : Real from Standard;
-    myPreviousDeviationAngle         : Real from Standard;
-
-    myhasOwnHLRDeviationAngle        : Boolean from Standard;
-    myOwnHLRDeviationAngle           : Real from Standard; 
-    myPreviousHLRDeviationAngle      : Real from Standard;
-    myHasOwnFaceBoundaryDraw         : Boolean from Standard;
-
-    myHasOwnDimLengthModelUnits      : Boolean from Standard;
-    myHasOwnDimLengthDisplayUnits    : Boolean from Standard;
-    myHasOwnDimAngleModelUnits      : Boolean from Standard;
-    myHasOwnDimAngleDisplayUnits    : Boolean from Standard;
-
-end Drawer;
-
diff --git a/src/AIS/AIS_Drawer.cxx b/src/AIS/AIS_Drawer.cxx
deleted file mode 100644 (file)
index 1890ba5..0000000
+++ /dev/null
@@ -1,418 +0,0 @@
-// Copyright (c) 1998-1999 Matra Datavision
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#include <AIS_Drawer.ixx>
-#include <Standard_ProgramError.hxx>
-
-// =======================================================================
-// function : AIS_Drawer
-// purpose  :
-// =======================================================================
-AIS_Drawer::AIS_Drawer()
-: myLink (new Prs3d_Drawer()),
-  hasLocalAttributes (Standard_False),
-  myhasOwnDeviationCoefficient (Standard_False),
-  myPreviousDeviationCoefficient (0.1),
-  myhasOwnHLRDeviationCoefficient (Standard_False),
-  myhasOwnDeviationAngle (Standard_False),
-  myhasOwnHLRDeviationAngle (Standard_False),
-  myHasOwnFaceBoundaryDraw (Standard_False),
-  myHasOwnDimLengthModelUnits (Standard_False),
-  myHasOwnDimLengthDisplayUnits (Standard_False),
-  myHasOwnDimAngleModelUnits (Standard_False),
-  myHasOwnDimAngleDisplayUnits (Standard_False)
-{
-  SetMaximalParameterValue (500000.0);
-  myLink->SetMaximalParameterValue (500000.0);
-  SetTypeOfHLR (Prs3d_TOH_NotSet);
-  SetVertexDrawMode (Prs3d_VDM_Inherited);
-}
-
-Aspect_TypeOfDeflection AIS_Drawer::TypeOfDeflection () const 
-{
-  return myLink->TypeOfDeflection();
-}
-
-Standard_Boolean AIS_Drawer::IsoOnPlane() const 
-{
-    return myLink->IsoOnPlane();
-}
-
-Standard_Integer AIS_Drawer::Discretisation() const 
-{
-  return myLink->Discretisation();
-}
-
-Quantity_Length AIS_Drawer::MaximalChordialDeviation() const 
-{
-  return myLink->MaximalChordialDeviation();
-}
-
-
-//=======================================================================
-//function : SetDeviationCoefficient
-//purpose  : 
-//=======================================================================
-
-void AIS_Drawer::SetDeviationCoefficient ( const Standard_Real  aCoefficient )
-{
-  myPreviousDeviationCoefficient = DeviationCoefficient() ;
-  myOwnDeviationCoefficient     = aCoefficient ;
-  myhasOwnDeviationCoefficient    = Standard_True; 
-}
-
-
-//=======================================================================
-//function : SetHLRDeviationCoefficient
-//purpose  : 
-//=======================================================================
-
-void AIS_Drawer::SetHLRDeviationCoefficient ( const Standard_Real  aCoefficient ) 
-{
-  myPreviousHLRDeviationCoefficient = HLRDeviationCoefficient() ;
-  myOwnHLRDeviationCoefficient     = aCoefficient ;
-  myhasOwnHLRDeviationCoefficient    = Standard_True; 
-}
-
-//=======================================================================
-//function : SetDeviationAngle
-//purpose  : 
-//=======================================================================
-
-void AIS_Drawer::SetDeviationAngle ( const Standard_Real anAngle ) 
-{
-  myPreviousDeviationAngle = DeviationAngle() ;
-  myOwnDeviationAngle     = anAngle ;
-  myhasOwnDeviationAngle    = Standard_True;   
-}
-
-//=======================================================================
-//function : SetHLRAngle
-//purpose  : 
-//=======================================================================
-
-void AIS_Drawer::SetHLRAngle ( const Standard_Real anAngle ) 
-{
-  myPreviousHLRDeviationAngle = HLRAngle() ;
-  myOwnHLRDeviationAngle     = anAngle ;
-  myhasOwnHLRDeviationAngle    = Standard_True;   
-}
-
-/////// Get
-//=======================================================================
-//function : DeviationCoefficient
-//purpose  : 
-//=======================================================================
-
-Standard_Real AIS_Drawer::DeviationCoefficient ()  const 
-{
-  return myhasOwnDeviationCoefficient? myOwnDeviationCoefficient :myLink->DeviationCoefficient();
-}
-
-//=======================================================================
-//function : HLRDeviationCoefficient
-//purpose  : 
-//=======================================================================
-
-Standard_Real AIS_Drawer::HLRDeviationCoefficient ()  const 
-{
-  return myhasOwnHLRDeviationCoefficient?myOwnHLRDeviationCoefficient : myLink->HLRDeviationCoefficient() ;
-}
-
-//=======================================================================
-//function : DeviationAngle
-//purpose  : 
-//=======================================================================
-
-Standard_Real AIS_Drawer::DeviationAngle ()  const 
-{
-  return myhasOwnDeviationAngle ? myOwnDeviationAngle :  myLink->DeviationAngle();
-}
-
-//=======================================================================
-//function : HLRAngle
-//purpose  : 
-//=======================================================================
-
-Standard_Real AIS_Drawer::HLRAngle ()  const 
-{
-  
-  return myhasOwnHLRDeviationAngle ?  myOwnHLRDeviationAngle : myLink->HLRAngle();
-}
-
-Standard_Real AIS_Drawer::MaximalParameterValue () const 
-{ return myLink->MaximalParameterValue();}
-
-Handle (Prs3d_IsoAspect) AIS_Drawer::UIsoAspect ()  
-{ return myUIsoAspect.IsNull() ? myLink->UIsoAspect (): myUIsoAspect;}
-
-Handle (Prs3d_IsoAspect) AIS_Drawer::VIsoAspect () 
-{ return myVIsoAspect.IsNull() ? myLink->VIsoAspect (): myVIsoAspect;}
-
-Handle (Prs3d_LineAspect) AIS_Drawer::FreeBoundaryAspect () 
-{return myFreeBoundaryAspect.IsNull() ? myLink->FreeBoundaryAspect (): myFreeBoundaryAspect;}
-
-Standard_Boolean AIS_Drawer::FreeBoundaryDraw () const 
-{return myLink->FreeBoundaryDraw();}
-
-Handle (Prs3d_LineAspect) AIS_Drawer::UnFreeBoundaryAspect ()  
-{return myUnFreeBoundaryAspect.IsNull() ? myLink->UnFreeBoundaryAspect (): myUnFreeBoundaryAspect;}
-
-Standard_Boolean AIS_Drawer::UnFreeBoundaryDraw ()  const  
-{return myLink->UnFreeBoundaryDraw ();}
-
-Handle (Prs3d_LineAspect) AIS_Drawer::WireAspect ()
-{  return myWireAspect.IsNull()? myLink->WireAspect (): myWireAspect;}
-
-Standard_Boolean AIS_Drawer::WireDraw ()  const 
-{ return myLink->WireDraw();}
-
-Handle (Prs3d_LineAspect) AIS_Drawer::LineAspect ()  
-{ return myLineAspect.IsNull() ? myLink->LineAspect (): myLineAspect;}
-
-Handle (Prs3d_TextAspect) AIS_Drawer::TextAspect ()  
-{ return myTextAspect.IsNull() ? myLink->TextAspect () : myTextAspect ;}
-
-Handle (Prs3d_ShadingAspect) AIS_Drawer::ShadingAspect ()
-{
-return myShadingAspect.IsNull() ? myLink->ShadingAspect ()  : myShadingAspect ;
-}
-
-Standard_Boolean AIS_Drawer::ShadingAspectGlobal()  const 
-{ return myLink->ShadingAspectGlobal();}
-
-Standard_Boolean AIS_Drawer::LineArrowDraw ()  const 
-{ return myLink->LineArrowDraw();}
-
-Handle (Prs3d_ArrowAspect) AIS_Drawer::ArrowAspect() 
-{return myArrowAspect.IsNull()?  myLink->ArrowAspect () :  myArrowAspect;}
-
-Handle (Prs3d_PointAspect) AIS_Drawer::PointAspect() 
-{return myPointAspect.IsNull()?  myLink->PointAspect () :  myPointAspect;}
-
-void AIS_Drawer::SetVertexDrawMode (const Prs3d_VertexDrawMode theMode)
-{
-  // Assuming that myLink always exists --> Prs3d_VDM_Inherited value is acceptable.
-  // So we simply store the new mode, as opposed to Prs3d_Drawer::SetVertexDrawMode()
-  myVertexDrawMode = theMode;
-}
-
-Prs3d_VertexDrawMode AIS_Drawer::VertexDrawMode () const
-{
-  return IsOwnVertexDrawMode() ? myVertexDrawMode : myLink->VertexDrawMode();
-}
-
-Standard_Boolean AIS_Drawer::DrawHiddenLine ()  const 
-{return myLink->DrawHiddenLine();}
-
-Handle (Prs3d_LineAspect) AIS_Drawer::HiddenLineAspect ()  
-{return  myHiddenLineAspect.IsNull()?  myLink->HiddenLineAspect () : myHiddenLineAspect;}
-
-Handle (Prs3d_LineAspect) AIS_Drawer::SeenLineAspect ()  
-{ return mySeenLineAspect.IsNull() ? myLink->SeenLineAspect (): mySeenLineAspect ;}
-
-Handle (Prs3d_LineAspect) AIS_Drawer::VectorAspect ()  
-{return myVectorAspect.IsNull()?  myLink->VectorAspect () : myVectorAspect;}
-
-Handle (Prs3d_DatumAspect) AIS_Drawer::DatumAspect () 
-{return myDatumAspect.IsNull()?  myLink->DatumAspect () : myDatumAspect; }
-
-Handle (Prs3d_PlaneAspect) AIS_Drawer::PlaneAspect () 
-{return myPlaneAspect.IsNull() ? myLink->PlaneAspect (): myPlaneAspect;}
-
-// =======================================================================
-// function : DimensionAspect
-// purpose  :
-// =======================================================================
-Handle (Prs3d_DimensionAspect) AIS_Drawer::DimensionAspect()
-{
-  return myDimensionAspect.IsNull()? myLink->DimensionAspect () : myDimensionAspect;
-}
-
-// =======================================================================
-// function : DimAngleModelUnits
-// purpose  :
-// =======================================================================
-const TCollection_AsciiString& AIS_Drawer::DimAngleModelUnits() const
-{
-  return myHasOwnDimAngleModelUnits
-    ? Prs3d_Drawer::DimAngleModelUnits()
-    : myLink->DimAngleModelUnits();
-}
-
-// =======================================================================
-// function : DimensionModelUnits
-// purpose  :
-// =======================================================================
-const TCollection_AsciiString& AIS_Drawer::DimLengthModelUnits() const
-{
-  return myHasOwnDimLengthModelUnits
-    ? Prs3d_Drawer::DimLengthModelUnits()
-    : myLink->DimLengthModelUnits();
-}
-// =======================================================================
-// function : SetDimLengthModelUnits
-// purpose  :
-// =======================================================================
-void AIS_Drawer::SetDimLengthModelUnits (const TCollection_AsciiString& theUnits)
-{
-  myHasOwnDimLengthModelUnits = Standard_True;
-  Prs3d_Drawer::SetDimLengthModelUnits (theUnits);
-}
-
-// =======================================================================
-// function : SetDimAngleModelUnits
-// purpose  :
-// =======================================================================
-void AIS_Drawer::SetDimAngleModelUnits (const TCollection_AsciiString& theUnits)
-{
-  myHasOwnDimAngleModelUnits = Standard_True;
-  Prs3d_Drawer::SetDimAngleModelUnits (theUnits);
-}
-
-// =======================================================================
-// function : DimAngleDisplayUnits
-// purpose  :
-// =======================================================================
-const TCollection_AsciiString& AIS_Drawer::DimAngleDisplayUnits() const
-{
-  return myHasOwnDimAngleDisplayUnits
-    ? Prs3d_Drawer::DimAngleDisplayUnits()
-    : myLink->DimAngleDisplayUnits();
-}
-
-// =======================================================================
-// function : DimLengthDisplayUnits
-// purpose  :
-// =======================================================================
-const TCollection_AsciiString& AIS_Drawer::DimLengthDisplayUnits() const
-{
-  return myHasOwnDimLengthDisplayUnits
-    ? Prs3d_Drawer::DimLengthDisplayUnits()
-    : myLink->DimLengthDisplayUnits();
-}
-
-// =======================================================================
-// function : SetDimLengthDisplayUnits
-// purpose  :
-// =======================================================================
-void AIS_Drawer::SetDimLengthDisplayUnits (const TCollection_AsciiString& theUnits)
-{
-  myHasOwnDimLengthDisplayUnits = Standard_True;
-  Prs3d_Drawer::SetDimLengthDisplayUnits (theUnits);
-}
-
-// =======================================================================
-// function : SetDimAngleDisplayUnits
-// purpose  :
-// =======================================================================
-void AIS_Drawer::SetDimAngleDisplayUnits (const TCollection_AsciiString& theUnits)
-{
-  myHasOwnDimAngleDisplayUnits = Standard_True;
-  Prs3d_Drawer::SetDimAngleDisplayUnits (theUnits);
-}
-
-Handle (Prs3d_LineAspect) AIS_Drawer::SectionAspect ()
-{return mySectionAspect.IsNull()? myLink->SectionAspect (): mySectionAspect;}
-
-const Handle (Prs3d_Drawer)& AIS_Drawer::Link()  
-{ 
-  if(myLink.IsNull()) myLink =  new Prs3d_Drawer();
-  return myLink;
- }
-
-void AIS_Drawer::ClearLocalAttributes()
-{
-  if(myLink.IsNull()) return;
-// attention pas beau....
-// The Handles
-
-  if(!myUIsoAspect.IsNull()) myUIsoAspect.Nullify();
-  if(!myVIsoAspect.IsNull()) myVIsoAspect.Nullify();
-  if(!myFreeBoundaryAspect.IsNull())  myFreeBoundaryAspect.Nullify();  
-  if(!myUnFreeBoundaryAspect.IsNull())  myUnFreeBoundaryAspect.Nullify();
-  if(!myWireAspect.IsNull())  myWireAspect.Nullify();          
-  if(!myLineAspect.IsNull())  myLineAspect.Nullify();          
-  if(!myTextAspect.IsNull())  myTextAspect.Nullify();   
-  if(!myShadingAspect.IsNull())  myShadingAspect.Nullify();
-  if(!myPointAspect.IsNull())  myPointAspect.Nullify();  
-  if(!myPlaneAspect.IsNull())  myPlaneAspect.Nullify();  
-  if(!myArrowAspect.IsNull())  myArrowAspect.Nullify();  
-  if(!myHiddenLineAspect.IsNull())  myHiddenLineAspect.Nullify();
-  if(!mySeenLineAspect.IsNull())  mySeenLineAspect.Nullify();  
-  if(!myVectorAspect.IsNull())  myVectorAspect .Nullify();   
-  if(!myDatumAspect.IsNull())  myDatumAspect.Nullify();     
-  if(!myDimensionAspect.IsNull())  myDimensionAspect.Nullify();    
-  if(!mySectionAspect.IsNull())  mySectionAspect.Nullify();   
-  if( myhasOwnHLRDeviationCoefficient )  myhasOwnHLRDeviationCoefficient = Standard_False;   
-  if(myhasOwnHLRDeviationAngle ) myhasOwnHLRDeviationAngle  = Standard_False;
-  if (!myFaceBoundaryAspect.IsNull()) myFaceBoundaryAspect.Nullify();
-  
-  myHasOwnFaceBoundaryDraw = Standard_False;
-  myHasOwnDimLengthModelUnits = Standard_False;
-  myHasOwnDimLengthDisplayUnits = Standard_False;
-  myHasOwnDimAngleModelUnits = Standard_False;
-  myHasOwnDimAngleDisplayUnits = Standard_False;
-
-  hasLocalAttributes = Standard_False;
-
-}
-
-// =======================================================================
-// function : SetFaceBoundaryDraw
-// purpose  :
-// =======================================================================
-void AIS_Drawer::SetFaceBoundaryDraw (const Standard_Boolean theIsEnabled)
-{
-  myHasOwnFaceBoundaryDraw = Standard_True;
-  myFaceBoundaryDraw       = theIsEnabled;
-}
-
-// =======================================================================
-// function : IsFaceBoundaryDraw
-// purpose  :
-// =======================================================================
-Standard_Boolean AIS_Drawer::IsFaceBoundaryDraw() const
-{
-  if (!IsOwnFaceBoundaryDraw ())
-  {
-    return myLink->IsFaceBoundaryDraw ();
-  }
-
-  return myFaceBoundaryDraw;
-}
-
-// =======================================================================
-// function : SetFaceBoundaryAspect
-// purpose  :
-// =======================================================================
-void AIS_Drawer::SetFaceBoundaryAspect (const Handle(Prs3d_LineAspect)& theAspect)
-{
-  myFaceBoundaryAspect = theAspect;
-}
-
-// =======================================================================
-// function : FaceBoundaryAspect
-// purpose  :
-// =======================================================================
-Handle(Prs3d_LineAspect) AIS_Drawer::FaceBoundaryAspect()
-{
-  if (!IsOwnFaceBoundaryAspect ())
-  {
-    return myLink->FaceBoundaryAspect ();
-  }
-
-  return myFaceBoundaryAspect;
-}
diff --git a/src/AIS/AIS_Drawer.lxx b/src/AIS/AIS_Drawer.lxx
deleted file mode 100644 (file)
index 84643f6..0000000
+++ /dev/null
@@ -1,180 +0,0 @@
-// Created on: 1996-12-19
-// Created by: Robert COUBLANC
-// Copyright (c) 1996-1999 Matra Datavision
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-inline Standard_Boolean AIS_Drawer::WasLastLocal() const
-{
-  return Standard_False;
-}
-
-inline Standard_Boolean AIS_Drawer::HasLocalAttributes() const
-{
-  return hasLocalAttributes;
-}
-
-inline Standard_Real AIS_Drawer::PreviousDeviationCoefficient() const
-{
-  return myhasOwnDeviationCoefficient ? myPreviousDeviationCoefficient : 0.0;
-}
-
-inline Standard_Real AIS_Drawer::PreviousHLRDeviationCoefficient() const
-{
-  return myhasOwnHLRDeviationCoefficient ? myPreviousHLRDeviationCoefficient : 0.0;
-}
-
-inline Standard_Real AIS_Drawer::PreviousDeviationAngle() const
-{
-  return myhasOwnDeviationAngle ? myPreviousDeviationAngle : 0.0;
-}
-
-inline Standard_Real AIS_Drawer::PreviousHLRDeviationAngle() const
-{
-  return myhasOwnHLRDeviationAngle ? myPreviousHLRDeviationAngle : 0.0;
-}
-
-inline void AIS_Drawer::Link (const Handle(Prs3d_Drawer)& theDrawer)
-{
-  myLink = theDrawer;
-}
-
-inline Standard_Boolean AIS_Drawer::HasLink() const
-{
-  return !myLink.IsNull();
-}
-
-inline void AIS_Drawer::SetDeviationCoefficient()
-{
-  myhasOwnDeviationCoefficient = Standard_False;
-}
-
-inline void AIS_Drawer::SetHLRDeviationCoefficient()
-{
-  myhasOwnHLRDeviationCoefficient = Standard_False;
-}
-
-inline void AIS_Drawer::SetDeviationAngle()
-{
-  myhasOwnDeviationAngle = Standard_False;
-}
-
-inline void AIS_Drawer::SetHLRAngle()
-{
-  myhasOwnHLRDeviationAngle = Standard_False;
-}
-
-inline Standard_Boolean AIS_Drawer::IsOwnDeviationCoefficient() const
-{
-  return myhasOwnDeviationCoefficient;
-}
-
-inline Standard_Boolean AIS_Drawer::IsOwnDeviationAngle() const
-{
-  return myhasOwnDeviationAngle;
-}
-
-inline Standard_Boolean AIS_Drawer::IsOwnHLRDeviationCoefficient() const
-{
-  return myhasOwnHLRDeviationCoefficient;
-}
-
-inline Standard_Boolean AIS_Drawer::IsOwnHLRDeviationAngle() const
-{
-  return myhasOwnHLRDeviationAngle;
-}
-
-inline Standard_Boolean AIS_Drawer::HasTextAspect() const
-{
-  return !myTextAspect.IsNull();
-}
-
-inline Standard_Boolean AIS_Drawer::HasWireAspect() const
-{
-  return !myWireAspect.IsNull();
-}
-
-inline Standard_Boolean AIS_Drawer::HasLineAspect() const
-{
-  return !myLineAspect.IsNull();
-}
-
-inline Standard_Boolean AIS_Drawer::HasShadingAspect() const
-{
-  return !myShadingAspect.IsNull();
-}
-
-inline Standard_Boolean AIS_Drawer::HasPointAspect() const
-{
-  return !myPointAspect.IsNull();
-}
-
-inline Standard_Boolean AIS_Drawer::IsOwnVertexDrawMode() const
-{
-  return (myVertexDrawMode != Prs3d_VDM_Inherited);
-}
-
-inline Standard_Boolean AIS_Drawer::HasDatumAspect() const
-{
-  return !myDatumAspect.IsNull();
-}
-
-inline Standard_Boolean AIS_Drawer::HasPlaneAspect() const
-{
-  return !myPlaneAspect.IsNull();
-}
-
-inline Standard_Boolean AIS_Drawer::HasUIsoAspect() const
-{
-  return !myUIsoAspect.IsNull();
-}
-
-inline Standard_Boolean AIS_Drawer::HasVIsoAspect() const
-{
-  return !myVIsoAspect.IsNull();
-}
-
-inline Standard_Boolean AIS_Drawer::HasFreeBoundaryAspect() const
-{
-  return !myFreeBoundaryAspect.IsNull();
-}
-
-inline Standard_Boolean AIS_Drawer::HasUnFreeBoundaryAspect() const
-{
-  return !myUnFreeBoundaryAspect.IsNull();
-}
-
-inline Standard_Boolean AIS_Drawer::IsOwnFaceBoundaryDraw() const
-{
-  return myHasOwnFaceBoundaryDraw;
-}
-
-inline Standard_Boolean AIS_Drawer::IsOwnFaceBoundaryAspect() const
-{
-  return !myFaceBoundaryAspect.IsNull();
-}
-
-inline void AIS_Drawer::SetTypeOfHLR (const Prs3d_TypeOfHLR theTypeOfHLR)
-{
-  myTypeOfHLR = theTypeOfHLR;
-}
-
-inline Prs3d_TypeOfHLR AIS_Drawer::TypeOfHLR() const
-{
-  return (myTypeOfHLR == Prs3d_TOH_NotSet) ? myLink->TypeOfHLR() : myTypeOfHLR;
-}
-
-inline Standard_Boolean AIS_Drawer::HasDimensionAspect() const
-{
-  return !myDimensionAspect.IsNull();
-}
index 823aa8c..fe9a1cb 100644 (file)
@@ -26,12 +26,12 @@ uses
     Shape from TopoDS,
     Plane from Geom,
     PresentationManager3d from PrsMgr,
+    Drawer from Prs3d,
     Presentation from Prs3d,
     Projector from Prs3d,
     Transformation        from Geom,
     Selection from SelectMgr,
     Pnt from gp,
-    Drawer from AIS,
     ExtendedString from TCollection,
     Edge from TopoDS,
     Vertex from TopoDS,
@@ -118,7 +118,7 @@ is
 -- ota -- begin
     ComputeTwoEdgesLength (myclass;
                           aPresentation : Presentation   from Prs3d; 
-                          aDrawer       :         Drawer         from AIS; 
+                          aDrawer       :         Drawer         from Prs3d;
                           ArrowSize     :         Real           from Standard;
                           FirstEdge     :         Edge           from TopoDS;
                           SecondEdge    :         Edge           from TopoDS;
@@ -138,7 +138,7 @@ is
                                    
     ComputeTwoVerticesLength(myclass; 
                             aPresentation : Presentation   from Prs3d;
-                            aDrawer       :         Drawer         from AIS; 
+                            aDrawer       :         Drawer         from Prs3d;
                             ArrowSize     :         Real           from Standard;
                             FirstVertex   :         Vertex         from TopoDS;
                             SecondVertex  :         Vertex         from TopoDS;
@@ -158,7 +158,7 @@ is
                                    
     ComputeOneEdgeOneVertexLength(myclass; 
                                  aPresentation : Presentation   from Prs3d;
-                                 aDrawer       :         Drawer         from AIS; 
+                                 aDrawer       :         Drawer         from Prs3d;
                                  ArrowSize     :         Real           from Standard;
                                  FirstShape    :         Shape          from TopoDS;
                                  SecondShape   :         Shape          from TopoDS;
index 47767f6..e4c7bcc 100644 (file)
@@ -39,7 +39,7 @@
 #include <Prs3d_ArrowAspect.hxx>
 #include <Geom_Line.hxx>
 #include <Geom_Circle.hxx>
-#include <AIS_Drawer.hxx>
+#include <Prs3d_Drawer.hxx>
 #include <ElCLib.hxx>
 //=======================================================================
 //function : AIS_EqualDistanceRelation
@@ -363,7 +363,7 @@ void AIS_EqualDistanceRelation::ComputeSelection( const Handle( SelectMgr_Select
 //purpose  : 
 //=======================================================================
 void AIS_EqualDistanceRelation::ComputeTwoEdgesLength( const Handle( Prs3d_Presentation )& aPresentation,
-                                                     const Handle( AIS_Drawer )& aDrawer,
+                                                     const Handle( Prs3d_Drawer )& aDrawer,
                                                      const Standard_Real ArrowSize,
                                                      const TopoDS_Edge & FirstEdge,
                                                      const TopoDS_Edge & SecondEdge,
@@ -591,7 +591,7 @@ void AIS_EqualDistanceRelation::ComputeTwoEdgesLength( const Handle( Prs3d_Prese
 //=======================================================================
 
 void AIS_EqualDistanceRelation::ComputeTwoVerticesLength( const Handle( Prs3d_Presentation )& aPresentation,
-                                                        const Handle( AIS_Drawer )& aDrawer,
+                                                        const Handle( Prs3d_Drawer )& aDrawer,
                                                         const Standard_Real ArrowSize,
                                                         const TopoDS_Vertex& FirstVertex,
                                                         const TopoDS_Vertex& SecondVertex,
@@ -682,7 +682,7 @@ void AIS_EqualDistanceRelation::ComputeTwoVerticesLength( const Handle( Prs3d_Pr
 //=======================================================================
 
 void AIS_EqualDistanceRelation::ComputeOneEdgeOneVertexLength( const Handle( Prs3d_Presentation )& aPresentation,
-                                                             const Handle( AIS_Drawer )& aDrawer,
+                                                             const Handle( Prs3d_Drawer )& aDrawer,
                                                              const Standard_Real ArrowSize,
                                                              const TopoDS_Shape & FirstShape,
                                                              const TopoDS_Shape & SecondShape,
index 0863d62..ff6e431 100644 (file)
@@ -32,7 +32,7 @@
 #include <GeomAPI_ProjectPointOnSurf.hxx>
 #include <Prs3d_DimensionAspect.hxx>
 #include <Prs3d_ArrowAspect.hxx>
-#include <AIS_Drawer.hxx>
+#include <Prs3d_Drawer.hxx>
 
 //=======================================================================
 //function : AIS_EqualRadiusRelation
index 2b6bb99..9947d35 100644 (file)
@@ -20,7 +20,6 @@
 
 #include <AIS.hxx>
 #include <AIS_Shape.hxx>
-#include <AIS_Drawer.hxx>
 
 #include <BRep_Tool.hxx>
 
index d8a5066..a8ae057 100644 (file)
@@ -99,7 +99,6 @@ uses
     MapOfInteractive      from AIS,
     InteractiveObject     from AIS,
     DisplayMode           from AIS,
-    Drawer                from AIS,
     NameOfMaterial        from Graphic3d,
     --NameOfPhysicalMaterial  from Graphic3d,
     Filter                from SelectMgr,
@@ -607,7 +606,7 @@ is
 
     SetLocalAttributes(me      : mutable; 
                       aniobj  : InteractiveObject from AIS;
-                      aDrawer : Drawer from AIS;
+                      aDrawer : Drawer from Prs3d;
             updateviewer : Boolean from Standard = Standard_True); 
 --- Purpose:
 -- Sets the attributes of the interactive object aniobj by
@@ -946,7 +945,7 @@ is
 -- deviate from a tangent to a   curve. If this limit is
 -- reached, a new triangle is begun.
 -- This deviation is absolute and is set through
--- AIS_Drawer::SetMaximalChordialDeviation. The
+-- Prs3d_Drawer::SetMaximalChordialDeviation. The
 -- default value is 0.001.
 -- In drawing shapes, however, you are allowed to ask
 -- for a relative deviation. This deviation will be:
index f5a00cf..ac16518 100644 (file)
@@ -2131,7 +2131,7 @@ void AIS_InteractiveContext::SetSelectedAspect (const Handle(Prs3d_BasicAspect)&
 //purpose  :
 //=======================================================================
 void AIS_InteractiveContext::SetLocalAttributes (const Handle(AIS_InteractiveObject)& theIObj,
-                                                 const Handle(AIS_Drawer)&            theDrawer,
+                                                 const Handle(Prs3d_Drawer)&          theDrawer,
                                                  const Standard_Boolean               theToUpdateViewer)
 {
   if (theIObj.IsNull())
index b3b4312..3bcaab2 100644 (file)
@@ -53,7 +53,6 @@ uses
     Box                  from Bnd,
     NameOfMaterial       from Graphic3d,
     MaterialAspect       from Graphic3d,
-    Drawer               from AIS,
     PToContext           from AIS,
     TypeOfPresentation3d from PrsMgr,
     InteractiveContext   from AIS,
@@ -485,16 +484,8 @@ is
         
     UnsetTransparency(me:mutable) is virtual;   
        ---Purpose: Removes the transparency setting. The object is opaque by default.
-    
-    SetAttributes(me:mutable; aDrawer: Drawer from AIS) is virtual; 
-       ---Purpose: Initializes the drawing tool aDrawer.
-    
-    Attributes(me) returns any Drawer from AIS;
-       ---C++: return const&
-       ---C++:  inline
-       ---Purpose: Returns the attributes settings.
-        
-    UnsetAttributes(me:mutable) is virtual;
+
+    UnsetAttributes(me:mutable) is redefined virtual;
        ---Purpose: Clears settings provided by the drawing tool aDrawer.
 
             ---Category: information about Prs to be recomputed
@@ -597,7 +588,6 @@ fields
 
     -- The Information Fields
 
-    myDrawer            : Drawer  from AIS is protected ;
     myTransparency      : Real    from Standard is protected;
     myOwnColor          : Color from Quantity is protected;
     myOwnMaterial       : NameOfMaterial from Graphic3d is protected;
index 89feda2..638729d 100644 (file)
@@ -45,7 +45,6 @@
 AIS_InteractiveObject::
 AIS_InteractiveObject(const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d):
 SelectMgr_SelectableObject(aTypeOfPresentation3d),
-myDrawer(new AIS_Drawer()),
 myTransparency(0.),
 myOwnColor(Quantity_NOC_WHITE),
 myOwnMaterial(Graphic3d_NOM_DEFAULT),
@@ -130,12 +129,6 @@ void AIS_InteractiveObject::SetContext(const Handle(AIS_InteractiveContext)& aCt
   myCTXPtr = aCtx.operator->();
   if( aCtx.IsNull())
     return;
-  if (myDrawer.IsNull()) {
-    myDrawer = new AIS_Drawer;
-#ifdef OCCT_DEBUG
-    cout << "AIS_InteractiveObject::SetContext DRAWER NUL!" << endl;
-#endif
-  }
   myDrawer->Link(aCtx->DefaultDrawer());
 }
 
@@ -285,15 +278,14 @@ void AIS_InteractiveObject::SetMaterial(const Graphic3d_NameOfMaterial aName)
 //void AIS_InteractiveObject::SetMaterial(const Graphic3d_NameOfPhysicalMaterial aName)
 {
   if( HasColor() || IsTransparent() || HasMaterial() )
-    {
-      myDrawer->ShadingAspect()->SetMaterial(aName);
-    }
-  else 
-    {
-      myDrawer->SetShadingAspect(new Prs3d_ShadingAspect());
-      
-      myDrawer->ShadingAspect()->SetMaterial(aName);
-    }
+  {
+    myDrawer->ShadingAspect()->SetMaterial(aName);
+  }
+  else
+  {
+    myDrawer->SetShadingAspect(new Prs3d_ShadingAspect());
+    myDrawer->ShadingAspect()->SetMaterial(aName);
+  }
   myOwnMaterial  = aName;
   hasOwnMaterial = Standard_True;
 }
@@ -304,17 +296,16 @@ void AIS_InteractiveObject::SetMaterial(const Graphic3d_NameOfMaterial aName)
 
 void AIS_InteractiveObject::SetMaterial(const Graphic3d_MaterialAspect& aMat)
 {
-  if( HasColor() || IsTransparent() || HasMaterial() )
-    {
-      myDrawer->ShadingAspect()->SetMaterial(aMat);
-    }
-  else 
-    {
-      myDrawer->SetShadingAspect(new Prs3d_ShadingAspect());
-      myDrawer->ShadingAspect()->SetMaterial(aMat);
-    }
+  if (HasColor() || IsTransparent() || HasMaterial())
+  {
+    myDrawer->ShadingAspect()->SetMaterial(aMat);
+  }
+  else
+  {
+    myDrawer->SetShadingAspect(new Prs3d_ShadingAspect());
+    myDrawer->ShadingAspect()->SetMaterial(aMat);
+  }
   hasOwnMaterial = Standard_True;
-  
 }
 //=======================================================================
 //function : 
@@ -323,11 +314,14 @@ void AIS_InteractiveObject::SetMaterial(const Graphic3d_MaterialAspect& aMat)
 void AIS_InteractiveObject::UnsetMaterial()
 {
   if( !HasMaterial() ) return;
-  if( HasColor() || IsTransparent()) {
-    myDrawer->ShadingAspect()->SetMaterial(
-               AIS_GraphicTool::GetMaterial(myDrawer->Link()));
-    if( HasColor() ) SetColor(myOwnColor);
-    if( IsTransparent() ) SetTransparency(myTransparency);
+  if (HasColor() || IsTransparent())
+  {
+    if(myDrawer->HasLink())
+    {
+      myDrawer->ShadingAspect()->SetMaterial (AIS_GraphicTool::GetMaterial (myDrawer->Link()));
+    }
+    if (HasColor()) SetColor (myOwnColor);
+    if (IsTransparent()) SetTransparency (myTransparency);
   }
   else{
     Handle(Prs3d_ShadingAspect) SA;
@@ -342,12 +336,11 @@ void AIS_InteractiveObject::UnsetMaterial()
 //=======================================================================
 void AIS_InteractiveObject::SetTransparency(const Standard_Real aValue)
 {
-
-
-  if(!HasColor() && !IsTransparent() && !HasMaterial() ) {
-        myDrawer->SetShadingAspect(new Prs3d_ShadingAspect());
-      if(!myDrawer->Link().IsNull())
-        myDrawer->ShadingAspect()->SetMaterial(AIS_GraphicTool::GetMaterial(myDrawer->Link()));
+  if(!HasColor() && !IsTransparent() && !HasMaterial())
+  {
+    myDrawer->SetShadingAspect(new Prs3d_ShadingAspect());
+    if(myDrawer->HasLink())
+      myDrawer->ShadingAspect()->SetMaterial(AIS_GraphicTool::GetMaterial(myDrawer->Link()));
   }
   Graphic3d_MaterialAspect FMat = myDrawer->ShadingAspect()->Aspect()->FrontMaterial();
   Graphic3d_MaterialAspect BMat = myDrawer->ShadingAspect()->Aspect()->BackMaterial();
@@ -363,14 +356,14 @@ void AIS_InteractiveObject::SetTransparency(const Standard_Real aValue)
 //=======================================================================
 void AIS_InteractiveObject::UnsetTransparency()
 {
-    if(HasColor() || HasMaterial() )
-    {
-      Graphic3d_MaterialAspect FMat = myDrawer->ShadingAspect()->Aspect()->FrontMaterial();
-      Graphic3d_MaterialAspect BMat = myDrawer->ShadingAspect()->Aspect()->BackMaterial();
-      FMat.SetTransparency(0.); BMat.SetTransparency(0.);
-      myDrawer->ShadingAspect()->Aspect()->SetFrontMaterial(FMat);
-      myDrawer->ShadingAspect()->Aspect()->SetBackMaterial(BMat);
-    }
+  if(HasColor() || HasMaterial() )
+  {
+    Graphic3d_MaterialAspect FMat = myDrawer->ShadingAspect()->Aspect()->FrontMaterial();
+    Graphic3d_MaterialAspect BMat = myDrawer->ShadingAspect()->Aspect()->BackMaterial();
+    FMat.SetTransparency(0.); BMat.SetTransparency(0.);
+    myDrawer->ShadingAspect()->Aspect()->SetFrontMaterial(FMat);
+    myDrawer->ShadingAspect()->Aspect()->SetBackMaterial(BMat);
+  }
   else{
     Handle (Prs3d_ShadingAspect) SA;
     myDrawer->SetShadingAspect(SA);
@@ -388,25 +381,14 @@ Standard_Real AIS_InteractiveObject::Transparency() const
 // return Mat.Transparency();
 }
 
-//=======================================================================
-//function : SetAttributes
-//purpose  : 
-//=======================================================================
-
-void AIS_InteractiveObject::SetAttributes(const Handle(AIS_Drawer)& aDrawer)
-{myDrawer = aDrawer;}
-
-
 //=======================================================================
 //function : UnsetAttributes
 //purpose  : 
 //=======================================================================
 void AIS_InteractiveObject::UnsetAttributes()
 {
-  Handle(AIS_Drawer) dr = new AIS_Drawer();
-  if(myDrawer->HasLink())
-    dr->Link(myDrawer->Link());
-  myDrawer       = dr;
+  SelectMgr_SelectableObject::UnsetAttributes();
+
   hasOwnColor    = Standard_False;
   hasOwnMaterial = Standard_False;
   myOwnWidth     = 0.0;
@@ -588,7 +570,7 @@ void AIS_InteractiveObject::SetPolygonOffsets(const Standard_Integer    aMode,
 Standard_Boolean AIS_InteractiveObject::HasPolygonOffsets() const
 {
   return !( myDrawer->ShadingAspect().IsNull() || 
-          ( !myDrawer->Link().IsNull() && 
+          ( myDrawer->HasLink() &&
           myDrawer->ShadingAspect() == myDrawer->Link()->ShadingAspect() ) );
 }
 
index fd60459..0f91cef 100644 (file)
@@ -78,10 +78,6 @@ inline Graphic3d_NameOfMaterial AIS_InteractiveObject::Material() const
 //inline Graphic3d_NameOfPhysicalMaterial AIS_InteractiveObject::Material() const 
 {return myOwnMaterial;}
 
-inline const Handle(AIS_Drawer)& 
-AIS_InteractiveObject::Attributes() const 
-{return myDrawer;}
-
 inline Standard_Boolean AIS_InteractiveObject::HasHilightMode() const  
 {return myHilightMode!=-1;}
 
index c4c8785..281d628 100755 (executable)
 
 #include <AIS.hxx>
 #include <AIS_Dimension.hxx>
-#include <AIS_Drawer.hxx>
 #include <AIS_KindOfDimension.hxx>
 #include <Geom_Plane.hxx>
 #include <Geom_Transformation.hxx>
 #include <gp_Pnt.hxx>
 #include <gp_Dir.hxx>
 #include <Prs3d_DimensionAspect.hxx>
+#include <Prs3d_Drawer.hxx>
 #include <Prs3d_Presentation.hxx>
 #include <Prs3d_Projector.hxx>
 #include <PrsMgr_PresentationManager3d.hxx>
@@ -44,7 +44,6 @@ class Prs3d_Presentation;
 class Prs3d_Projector;
 class Geom_Transformation;
 class SelectMgr_Selection;
-class AIS_Drawer;
 class Bnd_Box;
 class gp_Dir;
 class TopoDS_Vertex;
index f37626a..08e5a03 100644 (file)
@@ -27,7 +27,6 @@
 #include <StdPrs_Curve.hxx>
 #include <Geom_Line.hxx>
 #include <GeomAdaptor_Curve.hxx>
-#include <AIS_Drawer.hxx>
 #include <GC_MakeSegment.hxx>
 #include <Geom_Line.hxx>
 #include <Quantity_Color.hxx>
@@ -167,9 +166,10 @@ void AIS_Line::SetColor(const Quantity_Color &aCol)
   myOwnColor=aCol;
 
   Standard_Real WW = HasWidth()? myOwnWidth:
-                                 AIS_GraphicTool::GetLineWidth(myDrawer->Link(),AIS_TOA_Line);
+                                 myDrawer->HasLink() ?
+                                 AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line) : 1.;
 
-  if (!myDrawer->HasLineAspect ())
+  if (!myDrawer->HasOwnLineAspect ())
     myDrawer->SetLineAspect (new Prs3d_LineAspect(aCol,Aspect_TOL_SOLID,WW));
   else
     myDrawer->LineAspect()->SetColor(aCol);
@@ -188,9 +188,9 @@ void AIS_Line::UnsetColor()
 
   if (!HasWidth()) myDrawer->SetLineAspect(NullAsp);
   else{
-    Quantity_Color CC;
+    Quantity_Color CC = Quantity_NOC_YELLOW;
     if( HasColor() ) CC = myOwnColor;
-    else AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
+    else if (myDrawer->HasLink()) AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Line, CC);
     myDrawer->LineAspect()->SetColor(CC);
     myOwnColor = CC;
  }
@@ -204,11 +204,11 @@ void AIS_Line::SetWidth(const Standard_Real aValue)
 {
   myOwnWidth=aValue;
 
-  if (!myDrawer->HasLineAspect ()) {
-    Quantity_Color CC;
+  if (!myDrawer->HasOwnLineAspect ()) {
+    Quantity_Color CC = Quantity_NOC_YELLOW;
     if( HasColor() ) CC = myOwnColor;
-    else AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
-    myDrawer->SetLineAspect (new Prs3d_LineAspect(CC,Aspect_TOL_SOLID,aValue));
+    else if(myDrawer->HasLink()) AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Line, CC);
+    myDrawer->SetLineAspect (new Prs3d_LineAspect (CC, Aspect_TOL_SOLID, aValue));
   } else
     myDrawer->LineAspect()->SetWidth(aValue);
 }
@@ -224,7 +224,8 @@ void AIS_Line::UnsetWidth()
 
   if (!HasColor()) myDrawer->SetLineAspect(NullAsp);
   else{
-   Standard_Real WW = AIS_GraphicTool::GetLineWidth(myDrawer->Link(),AIS_TOA_Line);
+   Standard_Real WW = myDrawer->HasLink() ?
+     AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line) : 1.;
    myDrawer->LineAspect()->SetWidth(WW);
    myOwnWidth = WW;
   }
index adfc048..6ef3c3a 100644 (file)
@@ -56,7 +56,6 @@
 #include <gp_Vec.hxx>
 
 #include <AIS.hxx>
-#include <AIS_Drawer.hxx>
 
 #include <Precision.hxx>
 #include <DsgPrs_EllipseRadiusPresentation.hxx>
index be2f544..8ec70b4 100644 (file)
@@ -20,7 +20,6 @@
 #include <Precision.hxx>
 
 #include <AIS.hxx>
-#include <AIS_Drawer.hxx>
 
 #include <gce_MakeLin.hxx>
 #include <ElCLib.hxx>
index b03868c..39f8426 100644 (file)
@@ -57,7 +57,6 @@
 #include <gp_Vec.hxx>
 
 #include <AIS.hxx>
-#include <AIS_Drawer.hxx>
 
 #include <Precision.hxx>
 #include <DsgPrs_EllipseRadiusPresentation.hxx>
index 99fc454..a799327 100644 (file)
@@ -19,7 +19,6 @@
 #include <AIS_OffsetDimension.ixx>
 
 #include <AIS.hxx>
-#include <AIS_Drawer.hxx>
 #include <BRepBuilderAPI_Transform.hxx>
 #include <BRepAdaptor_Surface.hxx>
 #include <BRep_Tool.hxx>
index f5b0071..7b47bb2 100644 (file)
@@ -31,7 +31,6 @@
 #include <Prs3d_DimensionAspect.hxx>
 
 #include <AIS.hxx>
-#include <AIS_Drawer.hxx>
 
 #include <SelectMgr_EntityOwner.hxx>
 #include <Select3D_SensitiveSegment.hxx>
index 8d4bba6..a72c8f2 100644 (file)
@@ -53,8 +53,6 @@
 
 #include <Poly_Triangulation.hxx>
 
-#include <AIS_Drawer.hxx>
-
 #include <TCollection_AsciiString.hxx>
 
 //=======================================================================
@@ -375,10 +373,10 @@ void AIS_Plane::SetSize(const Standard_Real aXLength,
   DA = myDrawer->DatumAspect();
 
   Standard_Boolean yenavaitPA(Standard_True),yenavaitDA(Standard_True);
-  if(myDrawer->Link()->PlaneAspect() == PA){
+  if(myDrawer->HasLink() && myDrawer->Link()->PlaneAspect() == PA){
     yenavaitPA = Standard_False;
     PA = new Prs3d_PlaneAspect();}
-  if(myDrawer->Link()->DatumAspect() == DA){
+  if(myDrawer->HasLink() && myDrawer->Link()->DatumAspect() == DA){
     yenavaitDA = Standard_False;
     DA = new Prs3d_DatumAspect();
   }
@@ -406,13 +404,16 @@ void AIS_Plane::UnsetSize()
 {
   
   if(!myHasOwnSize) return;
-  if(!hasOwnColor){
-    myDrawer->PlaneAspect().Nullify();
-    myDrawer->DatumAspect().Nullify();
+  if(!hasOwnColor)
+  {
+    myDrawer->SetPlaneAspect (Handle(Prs3d_PlaneAspect)());
+    myDrawer->SetDatumAspect (Handle(Prs3d_DatumAspect)());
   }
   else{
-    const Handle(Prs3d_PlaneAspect)& PA = myDrawer->Link()->PlaneAspect();
-    const Handle(Prs3d_DatumAspect)& DA = myDrawer->Link()->DatumAspect();
+    const Handle(Prs3d_PlaneAspect) PA = myDrawer->HasLink() ? myDrawer->Link()->PlaneAspect() :
+                                                               new Prs3d_PlaneAspect();
+    const Handle(Prs3d_DatumAspect) DA = myDrawer->HasLink() ? myDrawer->Link()->DatumAspect() :
+                                                               new Prs3d_DatumAspect();
 
     myDrawer->PlaneAspect()->SetPlaneLength(PA->PlaneXLength(),PA->PlaneYLength());
     myDrawer->DatumAspect()->SetAxisLength(DA->FirstAxisLength(),
@@ -461,10 +462,10 @@ void AIS_Plane::SetColor(const Quantity_Color &aCol)
   DA = myDrawer->DatumAspect();
 
   Standard_Boolean yenavaitPA(Standard_True),yenavaitDA(Standard_True);
-  if(myDrawer->Link()->PlaneAspect() == PA){
+  if(myDrawer->HasLink() && myDrawer->Link()->PlaneAspect() == PA){
     yenavaitPA = Standard_False;
     PA = new Prs3d_PlaneAspect();}
-  if(myDrawer->Link()->DatumAspect() == DA){
+  if(myDrawer->HasLink() && myDrawer->Link()->DatumAspect() == DA){
     yenavaitDA = Standard_False;
     DA = new Prs3d_DatumAspect();
   }
@@ -491,12 +492,14 @@ void AIS_Plane::SetColor(const Quantity_Color &aCol)
 void AIS_Plane::UnsetColor()
 {
   if(!hasOwnColor) return;
-  if(!myHasOwnSize){
-    myDrawer->PlaneAspect().Nullify();
-    myDrawer->DatumAspect().Nullify();
+  if(!myHasOwnSize)
+  {
+    myDrawer->SetPlaneAspect (Handle(Prs3d_PlaneAspect)());
+    myDrawer->SetDatumAspect (Handle(Prs3d_DatumAspect)());
   }
   else{
-    const Handle(Prs3d_PlaneAspect)& PA = myDrawer->Link()->PlaneAspect();
+    const Handle(Prs3d_PlaneAspect) PA = myDrawer->HasLink() ? myDrawer->Link()->PlaneAspect() :
+                                                               new Prs3d_PlaneAspect();
 //    const Handle(Prs3d_DatumAspect)& DA = myDrawer->Link()->DatumAspect();
     Quantity_Color C;Aspect_TypeOfLine T;Standard_Real W;
     PA->EdgesAspect()->Aspect()->Values(C,T,W);
index c1b8aa3..dfc50e8 100644 (file)
@@ -43,7 +43,6 @@
 #include <Graphic3d_MaterialAspect.hxx>
 #include <Graphic3d_AspectFillArea3d.hxx>
 #include <Aspect_TypeOfLine.hxx>
-#include <AIS_Drawer.hxx>
 #include <UnitsAPI.hxx>
 #include <TColgp_Array1OfPnt.hxx>
 
index a808066..64f0a42 100644 (file)
@@ -29,7 +29,6 @@
 #include <StdPrs_Point.hxx>
 #include <Geom_Point.hxx>
 #include <BRepBuilderAPI_MakeVertex.hxx>
-#include <AIS_Drawer.hxx>
 
 #include <AIS_InteractiveContext.hxx>
 //=======================================================================
@@ -209,8 +208,9 @@ AcceptDisplayMode(const Standard_Integer aMode) const
 void AIS_Point::UpdatePointValues()
 {
 
-  if(!hasOwnColor && myOwnWidth==0.0 && !myHasTOM){
-    myDrawer->PointAspect().Nullify();
+  if(!hasOwnColor && myOwnWidth==0.0 && !myHasTOM)
+  {
+    myDrawer->SetPointAspect (Handle(Prs3d_PointAspect)());
     return;
   }
   Quantity_Color aCol;
@@ -232,7 +232,7 @@ void AIS_Point::UpdatePointValues()
   if(myHasTOM) aTOM = myTOM;
   
   
-  if(myDrawer->HasPointAspect()){
+  if(myDrawer->HasOwnPointAspect()){
     // CLE
     // const Handle(Prs3d_PointAspect) PA =  myDrawer->PointAspect();
     Handle(Prs3d_PointAspect) PA =  myDrawer->PointAspect();
index c9c588f..8b91840 100644 (file)
 
 #include <AIS_PointCloud.hxx>
 
-#include <AIS_Drawer.hxx>
 #include <AIS_GraphicTool.hxx>
 #include <Graphic3d_AspectFillArea3d.hxx>
 #include <Graphic3d_AspectMarker3d.hxx>
 #include <Graphic3d_Group.hxx>
+#include <Prs3d_Drawer.hxx>
 #include <Prs3d_PointAspect.hxx>
 #include <Prs3d_Presentation.hxx>
 #include <Prs3d_Root.hxx>
@@ -153,15 +153,21 @@ void AIS_PointCloud::SetColor (const Quantity_Color& theColor)
 {
   AIS_InteractiveObject::SetColor(theColor);
 
-  if (!myDrawer->HasPointAspect())
+  if (!myDrawer->HasOwnPointAspect())
   {
     myDrawer->SetPointAspect (new Prs3d_PointAspect (Aspect_TOM_POINT, theColor, 1.0));
-    *myDrawer->PointAspect()->Aspect() = *myDrawer->Link()->PointAspect()->Aspect();
+    if (myDrawer->HasLink())
+    {
+      *myDrawer->PointAspect()->Aspect() = *myDrawer->Link()->PointAspect()->Aspect();
+    }
   }
-  if (!myDrawer->HasShadingAspect())
+  if (!myDrawer->HasOwnShadingAspect())
   {
     myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
-    *myDrawer->ShadingAspect()->Aspect() = *myDrawer->Link()->ShadingAspect()->Aspect();
+    if (myDrawer->HasLink())
+    {
+      *myDrawer->ShadingAspect()->Aspect() = *myDrawer->Link()->ShadingAspect()->Aspect();
+    }
   }
 
   // Override color
@@ -220,20 +226,32 @@ void AIS_PointCloud::UnsetColor()
   }
   else
   {
-    Quantity_Color      aColor;
+    Quantity_Color      aColor = Quantity_NOC_YELLOW;
     Aspect_TypeOfMarker aType  = Aspect_TOM_POINT;
     Standard_Real       aScale = 1.0;
-    myDrawer->Link()->PointAspect()->Aspect()->Values (aColor, aType, aScale);
+    if (myDrawer->HasLink())
+    {
+      myDrawer->Link()->PointAspect()->Aspect()->Values (aColor, aType, aScale);
+    }
     myDrawer->PointAspect()->SetColor (aColor);
   }
 
   if (HasMaterial()
    || IsTransparent())
   {
-    Graphic3d_MaterialAspect aMat = AIS_GraphicTool::GetMaterial (HasMaterial() ? myDrawer : myDrawer->Link());
+    Graphic3d_MaterialAspect aDefaultMat (Graphic3d_NOM_BRASS);
+    Graphic3d_MaterialAspect aMat = aDefaultMat;
+    if (HasMaterial() || myDrawer->HasLink())
+    {
+      aMat = AIS_GraphicTool::GetMaterial (HasMaterial() ? myDrawer : myDrawer->Link());
+    }
     if (HasMaterial())
     {
-      Quantity_Color aColor = myDrawer->Link()->ShadingAspect()->Color (myCurrentFacingModel);
+      Quantity_Color aColor = aDefaultMat.AmbientColor();
+      if (myDrawer->HasLink())
+      {
+        aColor = myDrawer->Link()->ShadingAspect()->Color (myCurrentFacingModel);
+      }
       aMat.SetColor (aColor);
     }
     if (IsTransparent())
@@ -298,10 +316,13 @@ void AIS_PointCloud::SetMaterial (const Graphic3d_NameOfMaterial theMatName)
 //=======================================================================
 void AIS_PointCloud::SetMaterial (const Graphic3d_MaterialAspect& theMat)
 {
-  if (!myDrawer->HasShadingAspect())
+  if (!myDrawer->HasOwnShadingAspect())
   {
     myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
-    *myDrawer->ShadingAspect()->Aspect() = *myDrawer->Link()->ShadingAspect()->Aspect();
+    if (myDrawer->HasLink())
+    {
+      *myDrawer->ShadingAspect()->Aspect() = *myDrawer->Link()->ShadingAspect()->Aspect();
+    }
   }
   hasOwnMaterial = Standard_True;
 
@@ -350,7 +371,10 @@ void AIS_PointCloud::UnsetMaterial()
   if (HasColor()
    || IsTransparent())
   {
-    myDrawer->ShadingAspect()->SetMaterial (myDrawer->Link()->ShadingAspect()->Material (myCurrentFacingModel),
+    Graphic3d_MaterialAspect aDefaultMat (Graphic3d_NOM_BRASS);
+    myDrawer->ShadingAspect()->SetMaterial (myDrawer->HasLink() ?
+                                            myDrawer->Link()->ShadingAspect()->Material (myCurrentFacingModel) :
+                                            aDefaultMat,
                                             myCurrentFacingModel);
     if (HasColor())
     {
@@ -408,7 +432,7 @@ void AIS_PointCloud::Compute (const Handle(PrsMgr_PresentationManager3d)& /*theP
       }
 
       Handle(Graphic3d_AspectMarker3d) aMarkerAspect = myDrawer->PointAspect()->Aspect();
-      if (!myDrawer->HasPointAspect())
+      if (!myDrawer->HasOwnPointAspect())
       {
         aMarkerAspect->SetType (Aspect_TOM_POINT);
       }
index 6c339af..c8185d0 100644 (file)
@@ -19,7 +19,6 @@
 
 #include <AIS_Relation.ixx>
 
-#include <AIS_Drawer.hxx>
 #include <AIS_GraphicTool.hxx>
 #include <BRepBuilderAPI_MakeEdge.hxx>
 #include <BRep_Tool.hxx>
@@ -27,6 +26,7 @@
 #include <Geom_Line.hxx>
 #include <Geom_CartesianPoint.hxx>
 
+#include <Prs3d_Drawer.hxx>
 #include <Prs3d_LineAspect.hxx>
 #include <Prs3d_DimensionAspect.hxx>
 #include <Prs3d_PointAspect.hxx>
@@ -81,7 +81,7 @@ void AIS_Relation::ComputeProjEdgePresentation(const Handle(Prs3d_Presentation)&
                                               const Aspect_TypeOfLine aProjTOL,
                                               const Aspect_TypeOfLine aCallTOL) const 
 {
-  if (!myDrawer->HasWireAspect()){
+  if (!myDrawer->HasOwnWireAspect()){
     myDrawer->SetWireAspect(new Prs3d_LineAspect(aColor,aProjTOL,2.));}
   else {
     const Handle(Prs3d_LineAspect)& li = myDrawer->WireAspect();
@@ -171,7 +171,7 @@ void AIS_Relation::ComputeProjVertexPresentation(const Handle(Prs3d_Presentation
                                                 const Aspect_TypeOfMarker aProjTOM,
                                                 const Aspect_TypeOfLine aCallTOL) const 
 {
-  if (!myDrawer->HasPointAspect()){
+  if (!myDrawer->HasOwnPointAspect()){
     myDrawer->SetPointAspect(new Prs3d_PointAspect(aProjTOM, aColor,1));}
   else {
     const Handle(Prs3d_PointAspect)& pa = myDrawer->PointAspect();
@@ -182,7 +182,7 @@ void AIS_Relation::ComputeProjVertexPresentation(const Handle(Prs3d_Presentation
   // calcul du projete
   StdPrs_Point::Add(aPrs, new Geom_CartesianPoint(ProjPoint), myDrawer);
 
-  if (!myDrawer->HasWireAspect()){
+  if (!myDrawer->HasOwnWireAspect()){
     myDrawer->SetWireAspect(new Prs3d_LineAspect(aColor,aCallTOL,2.));}
   else {
     const Handle(Prs3d_LineAspect)& li = myDrawer->WireAspect();
@@ -213,16 +213,17 @@ void AIS_Relation::SetColor(const Quantity_Color &aCol)
 {
   if(hasOwnColor && myOwnColor==aCol) return;
 
-  if (!myDrawer->HasTextAspect()) myDrawer->SetTextAspect(new Prs3d_TextAspect());
+  if (!myDrawer->HasOwnTextAspect()) myDrawer->SetTextAspect(new Prs3d_TextAspect());
   hasOwnColor=Standard_True;
   myOwnColor=aCol;
   myDrawer->TextAspect()->SetColor(aCol);
 
-  Standard_Real WW = HasWidth()? Width():AIS_GraphicTool::GetLineWidth(myDrawer->Link(),AIS_TOA_Line);
-  if (!myDrawer->HasLineAspect()) {
+  Standard_Real WW = HasWidth()? Width(): myDrawer->HasLink() ?
+    AIS_GraphicTool::GetLineWidth(myDrawer->Link(),AIS_TOA_Line) : 1.;
+  if (!myDrawer->HasOwnLineAspect()) {
     myDrawer->SetLineAspect(new Prs3d_LineAspect(aCol,Aspect_TOL_SOLID,WW));
   }
-  if (!myDrawer->HasDimensionAspect()) {
+  if (!myDrawer->HasOwnDimensionAspect()) {
      myDrawer->SetDimensionAspect(new Prs3d_DimensionAspect);
   }
 
@@ -244,11 +245,14 @@ void AIS_Relation::UnsetColor()
   if (!hasOwnColor) return;
   hasOwnColor = Standard_False;
   const Handle(Prs3d_LineAspect)& LA = myDrawer->LineAspect();
-  Quantity_Color CC;
-  AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
+  Quantity_Color CC = Quantity_NOC_YELLOW;
+  if (myDrawer->HasLink())
+  {
+    AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
+    myDrawer->SetTextAspect(myDrawer->Link()->TextAspect());
+  }
   LA->SetColor(CC);
   myDrawer->DimensionAspect()->SetLineAspect(LA);
-  myDrawer->SetTextAspect(myDrawer->Link()->TextAspect());
 }
 
 //=======================================================================
index 81212e7..030d1bd 100644 (file)
@@ -34,7 +34,7 @@ class Shape from AIS inherits InteractiveObject from AIS
        -- an inheriting shape class. These services allow you to
        -- select one type of shape interactive object for higher
        -- precision drawing. When you do this, the
-       -- AIS_Drawer::IsOwn... functions corresponding to the
+       -- Prs3d_Drawer::IsOwn... functions corresponding to the
        -- above deviation angle and coefficient functions return
        -- true indicating that there is a local setting available
        -- for the specific object.
@@ -52,7 +52,6 @@ uses
     Projector             from Prs3d,
     PresentationManager3d from PrsMgr,
     Selection             from SelectMgr,
-    Drawer                from AIS,
     KindOfInteractive     from AIS,
     Transformation        from Geom,
     Drawer                from Prs3d,
@@ -99,7 +98,7 @@ uses
        ---Purpose: Sets a local value for deviation coefficient for this specific shape.
 
     SetOwnHLRDeviationCoefficient(me: mutable; aCoefficient : Real from Standard) ;  
-       ---Purpose: sets myOwnHLRDeviationCoefficient field in AIS_Drawer &
+       ---Purpose: sets myOwnHLRDeviationCoefficient field in Prs3d_Drawer &
        --          recomputes presentation 
         
     SetAngleAndDeviation(me:     mutable; anAngle: Real from Standard) ;  
@@ -110,7 +109,7 @@ uses
        ---Purpose: gives back the angle initial value put by the User.
     
     SetOwnDeviationAngle(me: mutable; anAngle: Real from Standard) ;  
-       ---Purpose: sets myOwnDeviationAngle field in AIS_Drawer & recomputes presentation
+       ---Purpose: sets myOwnDeviationAngle field in Prs3d_Drawer & recomputes presentation
     
     
     SetHLRAngleAndDeviation(me:     mutable; anAngle: Real from Standard) ;  
@@ -118,7 +117,7 @@ uses
        --   and set the values stored in myDrawer for with these that become local to the shape
 
     SetOwnHLRDeviationAngle(me: mutable; anAngle: Real from Standard) ;  
-       ---Purpose: sets myOwnHLRDeviationAngle field in AIS_Drawer & recomputes presentation
+       ---Purpose: sets myOwnHLRDeviationAngle field in Prs3d_Drawer & recomputes presentation
     
 
     OwnDeviationCoefficient(me; aCoefficient : out Real from Standard ;
@@ -194,16 +193,16 @@ uses
        ---Purpose: Sets the color aColor in the reconstructed
        -- compound shape. Acts via the Drawer methods below on the appearance of:
        -- -   free boundaries:
-       --   AIS_Drawer_FreeBoundaryAspect,
-       -- -   isos: AIS_Drawer_UIsoAspect,
-       --   AIS_Drawer_VIsoAspect,
+       --   Prs3d_Drawer_FreeBoundaryAspect,
+       -- -   isos: Prs3d_Drawer_UIsoAspect,
+       --   Prs3dDrawer_VIsoAspect,
        -- -   shared boundaries:
-       --   AIS_Drawer_UnFreeBoundaryAspect,
-       -- -   shading: AIS_Drawer_ShadingAspect,
+       --   Prs3d_Drawer_UnFreeBoundaryAspect,
+       -- -   shading: Prs3d_Drawer_ShadingAspect,
        -- -   visible line color in hidden line mode:
-       --   AIS_Drawer_SeenLineAspect
+       --   Prs3d_Drawer_SeenLineAspect
        -- -   hidden line color in hidden line mode:
-       --   AIS_Drawer_HiddenLineAspect.
+       --   Prs3d_Drawer_HiddenLineAspect.
         
     SetColor(me:mutable;aColor:Color from Quantity) 
     is redefined virtual;
@@ -283,22 +282,22 @@ uses
            ashape               : Shape from TopoDS) is static private;
 
     setColor (me;
-              theDrawer : Drawer from AIS;
+              theDrawer : Drawer from Prs3d;
               theColor  : Color  from Quantity)
     is protected;
 
     setWidth (me;
-              theDrawer : Drawer from AIS;
+              theDrawer : Drawer from Prs3d;
               theWidth  : Real   from Standard)
     is protected;
 
     setTransparency (me;
-                     theDrawer : Drawer from AIS;
+                     theDrawer : Drawer from Prs3d;
                      theValue  : Real   from Standard)
     is protected;
 
     setMaterial (me;
-                 theDrawer       : Drawer from AIS;
+                 theDrawer       : Drawer from Prs3d;
                  theMaterial     : MaterialAspect from Graphic3d;
                  theToKeepColor  : Boolean from Standard;
                  theToKeepTransp : Boolean from Standard)
index 34e8197..668dfe3 100644 (file)
@@ -66,7 +66,6 @@
 
 #include <AIS_GraphicTool.hxx>
 #include <AIS_InteractiveContext.hxx>
-#include <AIS_Drawer.hxx>
 #include <HLRBRep.hxx>
 #include <Precision.hxx>
 
@@ -94,10 +93,9 @@ static Standard_Boolean IsInList(const TColStd_ListOfInteger& LL, const Standard
 AIS_Shape::
 AIS_Shape(const TopoDS_Shape& shap):
 AIS_InteractiveObject(PrsMgr_TOP_ProjectorDependant),
-myshape(shap),
-myCompBB(Standard_True),
 myInitAng(0.)
 {
+  Set (shap);
   myFirstCompute = Standard_True;
   SetHilightMode(0);
   myDrawer->SetShadingAspectGlobal(Standard_False);
@@ -254,7 +252,7 @@ void AIS_Shape::Compute(const Handle(Prs3d_Projector)& aProjector,
   }
 
   Handle (Prs3d_Drawer) defdrawer = GetContext()->DefaultDrawer();
-  if (defdrawer->DrawHiddenLine()) 
+  if (defdrawer->DrawHiddenLine())
     {myDrawer->EnableDrawHiddenLine();}
   else {myDrawer->DisableDrawHiddenLine();}
 
@@ -440,28 +438,40 @@ void AIS_Shape::SetColor(const Quantity_NameOfColor aCol)
 //purpose  :
 //=======================================================================
 
-void AIS_Shape::setColor (const Handle(AIS_Drawer)& theDrawer,
-                          const Quantity_Color&     theColor) const
+void AIS_Shape::setColor (const Handle(Prs3d_Drawer)& theDrawer,
+                          const Quantity_Color&       theColor) const
 {
-  if (!theDrawer->HasShadingAspect())
+  if (!theDrawer->HasOwnShadingAspect())
   {
     theDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
-    *theDrawer->ShadingAspect()->Aspect() = *theDrawer->Link()->ShadingAspect()->Aspect();
+    if (theDrawer->HasLink())
+    {
+      *theDrawer->ShadingAspect()->Aspect() = *theDrawer->Link()->ShadingAspect()->Aspect();
+    }
   }
-  if (!theDrawer->HasLineAspect())
+  if (!theDrawer->HasOwnLineAspect())
   {
     theDrawer->SetLineAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
-    *theDrawer->LineAspect()->Aspect() = *theDrawer->Link()->LineAspect()->Aspect();
+    if (theDrawer->HasLink())
+    {
+      *theDrawer->LineAspect()->Aspect() = *theDrawer->Link()->LineAspect()->Aspect();
+    }
   }
-  if (!theDrawer->HasWireAspect())
+  if (!theDrawer->HasOwnWireAspect())
   {
     theDrawer->SetWireAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
-    *theDrawer->WireAspect()->Aspect() = *theDrawer->Link()->WireAspect()->Aspect();
+    if (theDrawer->HasLink())
+    {
+      *theDrawer->WireAspect()->Aspect() = *theDrawer->Link()->WireAspect()->Aspect();
+    }
   }
-  if (!theDrawer->HasPointAspect())
+  if (!theDrawer->HasOwnPointAspect())
   {
     theDrawer->SetPointAspect (new Prs3d_PointAspect (Aspect_TOM_POINT, Quantity_NOC_BLACK, 1.0));
-    *theDrawer->PointAspect()->Aspect() = *theDrawer->Link()->PointAspect()->Aspect();
+    if (theDrawer->HasLink())
+    {
+      *theDrawer->PointAspect()->Aspect() = *theDrawer->Link()->PointAspect()->Aspect();
+    }
   }
   // disable dedicated line aspects
   theDrawer->SetFreeBoundaryAspect  (theDrawer->LineAspect());
@@ -559,26 +569,53 @@ void AIS_Shape::UnsetColor()
   }
   else
   {
-    Quantity_Color aColor;
-    AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Line,   aColor);
+    Quantity_Color aColor = Quantity_NOC_YELLOW;
+    if (myDrawer->HasLink())
+    {
+      AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Line,   aColor);
+    }
     myDrawer->LineAspect()->SetColor (aColor);
-    AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Wire,   aColor);
+    aColor = Quantity_NOC_RED;
+    if (myDrawer->HasLink())
+    {
+      AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Wire,   aColor);
+    }
     myDrawer->WireAspect()->SetColor (aColor);
-    AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Free,   aColor);
+    aColor = Quantity_NOC_GREEN;
+    if (myDrawer->HasLink())
+    {
+      AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Free,   aColor);
+    }
     myDrawer->FreeBoundaryAspect()->SetColor (aColor);
-    AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_UnFree, aColor);
+    aColor = Quantity_NOC_YELLOW;
+    if (myDrawer->HasLink())
+    {
+      AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_UnFree, aColor);
+    }
     myDrawer->UnFreeBoundaryAspect()->SetColor (aColor);
-    AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Seen,   aColor);
+    if (myDrawer->HasLink())
+    {
+      AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Seen,   aColor);
+    }
     myDrawer->SeenLineAspect()->SetColor (aColor);
   }
 
   if (HasMaterial()
    || IsTransparent())
   {
-    Graphic3d_MaterialAspect mat = AIS_GraphicTool::GetMaterial(HasMaterial()? myDrawer : myDrawer->Link());
+    Graphic3d_MaterialAspect aDefaultMat (Graphic3d_NOM_BRASS);
+    Graphic3d_MaterialAspect mat = aDefaultMat;
+    if (HasMaterial() || myDrawer->HasLink())
+    {
+      mat = AIS_GraphicTool::GetMaterial(HasMaterial()? myDrawer : myDrawer->Link());
+    }
     if (HasMaterial())
     {
-      Quantity_Color aColor = myDrawer->Link()->ShadingAspect()->Color (myCurrentFacingModel);
+      Quantity_Color aColor = aDefaultMat.AmbientColor();
+      if (myDrawer->HasLink())
+      {
+        Quantity_Color aColor = myDrawer->Link()->ShadingAspect()->Color (myCurrentFacingModel);
+      }
       mat.SetColor (aColor);
     }
     if (IsTransparent())
@@ -638,18 +675,24 @@ void AIS_Shape::UnsetColor()
 //purpose  :
 //=======================================================================
 
-void AIS_Shape::setWidth (const Handle(AIS_Drawer)& theDrawer,
-                          const Standard_Real       theLineWidth) const
+void AIS_Shape::setWidth (const Handle(Prs3d_Drawer)& theDrawer,
+                          const Standard_Real         theLineWidth) const
 {
-  if (!theDrawer->HasLineAspect())
+  if (!theDrawer->HasOwnLineAspect())
   {
     theDrawer->SetLineAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
-    *theDrawer->LineAspect()->Aspect() = *theDrawer->Link()->LineAspect()->Aspect();
+    if (theDrawer->HasLink())
+    {
+      *theDrawer->LineAspect()->Aspect() = *theDrawer->Link()->LineAspect()->Aspect();
+    }
   }
-  if (!theDrawer->HasWireAspect())
+  if (!theDrawer->HasOwnWireAspect())
   {
     theDrawer->SetWireAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
-    *theDrawer->WireAspect()->Aspect() = *theDrawer->Link()->WireAspect()->Aspect();
+    if (theDrawer->HasLink())
+    {
+      *theDrawer->WireAspect()->Aspect() = *theDrawer->Link()->WireAspect()->Aspect();
+    }
   }
   // disable dedicated line aspects
   theDrawer->SetFreeBoundaryAspect  (theDrawer->LineAspect());
@@ -701,11 +744,16 @@ void AIS_Shape::UnsetWidth()
   }
   else
   {
-    myDrawer->LineAspect()          ->SetWidth (AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line));
-    myDrawer->WireAspect()          ->SetWidth (AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Wire));
-    myDrawer->FreeBoundaryAspect()  ->SetWidth (AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Free));
-    myDrawer->UnFreeBoundaryAspect()->SetWidth (AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_UnFree));
-    myDrawer->SeenLineAspect()      ->SetWidth (AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Seen));
+    myDrawer->LineAspect()          ->SetWidth (myDrawer->HasLink() ?
+      AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line) : 1.);
+    myDrawer->WireAspect()          ->SetWidth (myDrawer->HasLink() ?
+      AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Wire) : 1.);
+    myDrawer->FreeBoundaryAspect()  ->SetWidth (myDrawer->HasLink() ?
+      AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Free) : 1.);
+    myDrawer->UnFreeBoundaryAspect()->SetWidth (myDrawer->HasLink() ?
+      AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_UnFree) : 1.);
+    myDrawer->SeenLineAspect()      ->SetWidth (myDrawer->HasLink() ?
+      AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Seen) : 1.);
   }
   LoadRecomputable (AIS_WireFrame);
 }
@@ -715,17 +763,20 @@ void AIS_Shape::UnsetWidth()
 //purpose  :
 //=======================================================================
 
-void AIS_Shape::setMaterial (const Handle(AIS_Drawer)&       theDrawer,
+void AIS_Shape::setMaterial (const Handle(Prs3d_Drawer)&     theDrawer,
                              const Graphic3d_MaterialAspect& theMaterial,
                              const Standard_Boolean          theToKeepColor,
                              const Standard_Boolean          theToKeepTransp) const
 {
   const Quantity_Color aColor  = theDrawer->ShadingAspect()->Material     (myCurrentFacingModel).Color();
   const Standard_Real  aTransp = theDrawer->ShadingAspect()->Transparency (myCurrentFacingModel);
-  if (!theDrawer->HasShadingAspect())
+  if (!theDrawer->HasOwnShadingAspect())
   {
     theDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
-    *theDrawer->ShadingAspect()->Aspect() = *theDrawer->Link()->ShadingAspect()->Aspect();
+    if (theDrawer->HasLink())
+    {
+      *theDrawer->ShadingAspect()->Aspect() = *theDrawer->Link()->ShadingAspect()->Aspect();
+    }
   }
   theDrawer->ShadingAspect()->SetMaterial (theMaterial, myCurrentFacingModel);
 
@@ -805,8 +856,11 @@ void AIS_Shape::UnsetMaterial()
   if (HasColor()
    || IsTransparent())
   {
-    myDrawer->ShadingAspect()->SetMaterial (myDrawer->Link()->ShadingAspect()->Material (myCurrentFacingModel),
-                                            myCurrentFacingModel);
+    if(myDrawer->HasLink())
+    {
+      myDrawer->ShadingAspect()->SetMaterial (myDrawer->Link()->ShadingAspect()->Material (myCurrentFacingModel),
+                                              myCurrentFacingModel);
+    }
     if (HasColor())
     {
       myDrawer->ShadingAspect()->SetColor        (myOwnColor,     myCurrentFacingModel);
@@ -851,13 +905,16 @@ void AIS_Shape::UnsetMaterial()
 //purpose  :
 //=======================================================================
 
-void AIS_Shape::setTransparency (const Handle(AIS_Drawer)& theDrawer,
-                                 const Standard_Real       theValue) const
+void AIS_Shape::setTransparency (const Handle(Prs3d_Drawer)& theDrawer,
+                                 const Standard_Real         theValue) const
 {
-  if (!theDrawer->HasShadingAspect())
+  if (!theDrawer->HasOwnShadingAspect())
   {
     theDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
-    *theDrawer->ShadingAspect()->Aspect() = *theDrawer->Link()->ShadingAspect()->Aspect();
+    if (theDrawer->HasLink())
+    {
+      *theDrawer->ShadingAspect()->Aspect() = *theDrawer->Link()->ShadingAspect()->Aspect();
+    }
   }
 
   // override transparency
@@ -910,7 +967,7 @@ void AIS_Shape::SetTransparency (const Standard_Real theValue)
 void AIS_Shape::UnsetTransparency()
 {
   myTransparency = 0.0;
-  if (!myDrawer->HasShadingAspect())
+  if (!myDrawer->HasOwnShadingAspect())
   {
     return;
   }
@@ -996,7 +1053,7 @@ const Bnd_Box& AIS_Shape::BoundingBox()
 
 Standard_Boolean AIS_Shape::SetOwnDeviationCoefficient ()
 {
-  Standard_Boolean itSet = myDrawer->IsOwnDeviationCoefficient();
+  Standard_Boolean itSet = myDrawer->HasOwnDeviationCoefficient();
   if(itSet)  myDrawer->SetDeviationCoefficient();
   return itSet;
 }
@@ -1009,7 +1066,7 @@ Standard_Boolean AIS_Shape::SetOwnDeviationCoefficient ()
 
 Standard_Boolean AIS_Shape::SetOwnHLRDeviationCoefficient ()
 {
-  Standard_Boolean itSet = myDrawer->IsOwnHLRDeviationCoefficient();
+  Standard_Boolean itSet = myDrawer->HasOwnHLRDeviationCoefficient();
   if(itSet)  myDrawer->SetHLRDeviationCoefficient();
   return itSet;
 
@@ -1023,7 +1080,7 @@ Standard_Boolean AIS_Shape::SetOwnHLRDeviationCoefficient ()
 
 Standard_Boolean AIS_Shape::SetOwnDeviationAngle ()
 {
-  Standard_Boolean itSet = myDrawer->IsOwnDeviationAngle();
+  Standard_Boolean itSet = myDrawer->HasOwnDeviationAngle();
   if(itSet)  myDrawer->SetDeviationAngle();
   return itSet;
 
@@ -1037,7 +1094,7 @@ Standard_Boolean AIS_Shape::SetOwnDeviationAngle ()
 
 Standard_Boolean AIS_Shape::SetOwnHLRDeviationAngle ()
 {
-  Standard_Boolean itSet = myDrawer->IsOwnHLRDeviationAngle();
+  Standard_Boolean itSet = myDrawer->HasOwnHLRDeviationAngle();
   if(itSet)  myDrawer->SetHLRAngle();
   return itSet;
 
@@ -1138,7 +1195,7 @@ Standard_Boolean AIS_Shape::OwnDeviationCoefficient ( Standard_Real &  aCoeffici
 {
   aCoefficient = myDrawer->DeviationCoefficient();
   aPreviousCoefficient = myDrawer->PreviousDeviationCoefficient ();
-  return myDrawer->IsOwnDeviationCoefficient() ;
+  return myDrawer->HasOwnDeviationCoefficient() ;
 }
 
 //=======================================================================
@@ -1151,7 +1208,7 @@ Standard_Boolean AIS_Shape::OwnHLRDeviationCoefficient ( Standard_Real & aCoeffi
 {
   aCoefficient = myDrawer->HLRDeviationCoefficient();
   aPreviousCoefficient = myDrawer->PreviousHLRDeviationCoefficient ();
-  return myDrawer->IsOwnHLRDeviationCoefficient();
+  return myDrawer->HasOwnHLRDeviationCoefficient();
 
 }
 
@@ -1165,7 +1222,7 @@ Standard_Boolean AIS_Shape::OwnDeviationAngle ( Standard_Real &  anAngle,
 {
   anAngle = myDrawer->DeviationAngle();
   aPreviousAngle = myDrawer->PreviousDeviationAngle (); 
-  return myDrawer->IsOwnDeviationAngle();
+  return myDrawer->HasOwnDeviationAngle();
 }
 
 //=======================================================================
@@ -1178,5 +1235,5 @@ Standard_Boolean AIS_Shape::OwnHLRDeviationAngle ( Standard_Real &  anAngle,
 {
   anAngle = myDrawer->HLRAngle();
   aPreviousAngle = myDrawer->PreviousHLRDeviationAngle (); 
-  return myDrawer->IsOwnHLRDeviationAngle();
+  return myDrawer->HasOwnHLRDeviationAngle();
 }
index ffe99e8..2837f1a 100644 (file)
@@ -14,7 +14,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#include <AIS_Drawer.hxx>
+#include <Prs3d_Drawer.hxx>
 
 inline void AIS_Shape::Set(const TopoDS_Shape& ashap)
 {
index 4d8b51f..dc822b5 100644 (file)
@@ -18,7 +18,6 @@
 
 #include <AIS_SymmetricRelation.ixx>
 #include <AIS.hxx>
-#include <AIS_Drawer.hxx>
 
 #include <gce_MakeLin.hxx>
 #include <SelectMgr_EntityOwner.hxx>
index 340df0e..ca9845c 100644 (file)
@@ -15,7 +15,6 @@
 
 #include <AIS_TexturedShape.hxx>
 
-#include <AIS_Drawer.hxx>
 #include <AIS_GraphicTool.hxx>
 #include <AIS_InteractiveContext.hxx>
 #include <BRepTools.hxx>
@@ -25,6 +24,7 @@
 #include <Graphic3d_StructureManager.hxx>
 #include <Graphic3d_Texture2Dmanual.hxx>
 #include <Precision.hxx>
+#include <Prs3d_Drawer.hxx>
 #include <Prs3d_Presentation.hxx>
 #include <PrsMgr_ModedPresentation.hxx>
 #include <Prs3d_Root.hxx>
index aa3c4d5..f1abe2f 100644 (file)
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#include <AIS_Drawer.hxx>
 #include <AIS_Triangulation.hxx>
 #include <AIS_InteractiveObject.hxx>
 #include <Standard_DefineHandle.hxx>
 #include <Poly_Array1OfTriangle.hxx>
 #include <Poly_Triangulation.hxx>
+#include <Prs3d_Drawer.hxx>
 #include <Prs3d_Root.hxx>
 #include <Prs3d_ShadingAspect.hxx>
 #include <TShort_Array1OfShortReal.hxx>
index 3b3b1e1..149c659 100644 (file)
@@ -32,7 +32,7 @@ class Trihedron from AIS inherits InteractiveObject from AIS
        -- dimensions, you must temporarily recover the Drawer.
        -- From inside it, you take the aspect in which the values
        -- for length are stocked. For trihedra, this is
-       -- AIS_Drawer_FirstAxisAspect. You change the
+       -- Prs3d_Drawer_FirstAxisAspect. You change the
        -- values inside this Aspect and recalculate the presentation.
        -- If you want to use extended selection modes, different than 0,
        -- you should take care of removing of the shapes from the interactive
index 3fe1180..52f5630 100644 (file)
@@ -41,7 +41,6 @@
 #include <Graphic3d_MaterialAspect.hxx>
 #include <Graphic3d_AspectFillArea3d.hxx>
 #include <Aspect_TypeOfLine.hxx>
-#include <AIS_Drawer.hxx>
 #include <AIS_Plane.hxx>
 #include <AIS_Axis.hxx>
 #include <AIS_Point.hxx>
@@ -118,7 +117,7 @@ void AIS_Trihedron::SetLocalTransformation (const gp_Trsf& theTransformation)
 void AIS_Trihedron::SetSize(const Standard_Real aValue)
 {
   myHasOwnSize = Standard_True;
-  if(!myDrawer->HasDatumAspect()){
+  if(!myDrawer->HasOwnDatumAspect()){
     Handle (Prs3d_DatumAspect) DA = new Prs3d_DatumAspect();
     myDrawer->SetDatumAspect(DA);
   }
@@ -146,13 +145,16 @@ void AIS_Trihedron::UnsetSize()
   
   myHasOwnSize = Standard_False;
   if(hasOwnColor){
-    const Handle(Prs3d_DatumAspect)& DA = myDrawer->Link()->DatumAspect();
+    const Handle(Prs3d_DatumAspect) DA =
+      myDrawer->HasLink() ? myDrawer->Link()->DatumAspect() : new Prs3d_DatumAspect();
     myDrawer->DatumAspect()->SetAxisLength(DA->FirstAxisLength(),
                                           DA->SecondAxisLength(),
                                           DA->ThirdAxisLength());
   }
   else
-    myDrawer->DatumAspect().Nullify();
+  {
+    myDrawer->SetDatumAspect (Handle(Prs3d_DatumAspect)());
+  }
   Update();
   UpdateSelection();
 
@@ -165,15 +167,7 @@ void AIS_Trihedron::UnsetSize()
 
 Standard_Real AIS_Trihedron::Size() const 
 {
-  if(myDrawer->HasDatumAspect()){
-    myDrawer->Link()->DatumAspect(); // ? to ensure that myDrawer->myLink is not null for next call ?
-    return myDrawer->DatumAspect()->FirstAxisLength();
-  }
-  else
-    //return the Defaut value
-    return 100. ;
-    
-
+  return myDrawer->DatumAspect()->FirstAxisLength();
 }
 
 //=======================================================================
@@ -363,7 +357,7 @@ void AIS_Trihedron::ComputeSelection(const Handle(SelectMgr_Selection)& aSelecti
         {
           // update AIS_Axis for selection
           Handle(AIS_Axis) anAxis = Handle(AIS_Axis)::DownCast(myShapes[anIdx]);
-          Handle(AIS_Drawer) aDrawer = anAxis->Attributes();
+          Handle(Prs3d_Drawer) aDrawer = anAxis->Attributes();
           Handle(Prs3d_DatumAspect) aDatum = myDrawer->DatumAspect();
           aDrawer->DatumAspect()->SetAxisLength (aDatum->FirstAxisLength(),
                                                  aDatum->SecondAxisLength(),
@@ -427,7 +421,7 @@ void AIS_Trihedron::SetColor(const Quantity_Color &aCol)
   hasOwnColor=Standard_True;
   myOwnColor = aCol;
   
-  if(!myDrawer->HasDatumAspect()){
+  if(!myDrawer->HasOwnDatumAspect()){
     Handle (Prs3d_DatumAspect) DA = new Prs3d_DatumAspect();
     
     DA->SetAxisLength(myDrawer->DatumAspect()->FirstAxisLength(),
@@ -451,7 +445,7 @@ void AIS_Trihedron::SetTextColor(const Quantity_NameOfColor aCol)
   myHasOwnTextColor = Standard_True;
   myOwnTextColor = aCol;
   
-  if(!myDrawer->HasDatumAspect()){
+  if(!myDrawer->HasOwnDatumAspect()){
     Handle (Prs3d_DatumAspect) DA = new Prs3d_DatumAspect();
     
     DA->SetAxisLength(myDrawer->DatumAspect()->FirstAxisLength(),
@@ -469,7 +463,7 @@ void AIS_Trihedron::SetArrowColor(const Quantity_NameOfColor aCol)
   myHasOwnArrowColor = Standard_True;
   myOwnArrowColor = aCol;
   
-  if(!myDrawer->HasDatumAspect()){
+  if(!myDrawer->HasOwnDatumAspect()){
     Handle (Prs3d_DatumAspect) DA = new Prs3d_DatumAspect();
     
     DA->SetAxisLength(myDrawer->DatumAspect()->FirstAxisLength(),
index 4bb14f4..b84ed4b 100644 (file)
@@ -38,7 +38,6 @@
 #include <ViewerTest.hxx>
 #include <AIS_InteractiveContext.hxx> 
 #include <AIS_InteractiveObject.hxx>
-#include <AIS_Drawer.hxx> 
 #include <ViewerTest.hxx>
 #include <V3d_View.hxx>
 #include <TCollection_ExtendedString.hxx>
index 93df001..00312ad 100644 (file)
@@ -18,7 +18,6 @@
 
 #include <PPrsStd_AISPresentation.hxx>
 #include <TPrsStd_AISPresentation.hxx>
-#include <AIS_Drawer.hxx>
 #include <TCollection_ExtendedString.hxx>
 #include <PCollection_HExtendedString.hxx>
 #include <Quantity_NameOfColor.hxx>
index e0148bc..606792f 100644 (file)
@@ -18,7 +18,6 @@
 
 #include <PPrsStd_AISPresentation_1.hxx>
 #include <TPrsStd_AISPresentation.hxx>
-#include <AIS_Drawer.hxx>
 #include <TCollection_ExtendedString.hxx>
 #include <PCollection_HExtendedString.hxx>
 #include <Quantity_NameOfColor.hxx>
index 6bba5f5..9c04c74 100644 (file)
@@ -21,7 +21,6 @@
 #include <TPrsStd_AISPresentation.hxx>
 #include <AIS_InteractiveObject.hxx>
 #include <AIS_InteractiveContext.hxx>
-#include <AIS_Drawer.hxx>
 #include <V3d_Viewer.hxx>
 #include <TCollection_ExtendedString.hxx>
 #include <PCollection_HExtendedString.hxx>
index 4d9f6c4..32d4ea0 100644 (file)
@@ -27,6 +27,7 @@
 #include <Graphic3d_Group.hxx>
 #include <Graphic3d_TextureParams.hxx>
 
+#include <Prs3d_Drawer.hxx>
 #include <Prs3d_ShadingAspect.hxx>
 #include <Prs3d_Root.hxx>
 #include <Prs3d_LineAspect.hxx>
@@ -56,7 +57,6 @@
 #include <Graphic3d_TypeOfTextureMode.hxx>
 #include <Standard_DefineHandle.hxx>
 #include <PrsMgr_PresentationManager3d.hxx>
-#include <AIS_Drawer.hxx>
 #include <Quantity_Array1OfColor.hxx>
 #include <Aspect_SequenceOfColor.hxx>
 
@@ -438,12 +438,12 @@ void MeshVS_NodalColorPrsBuilder::Build ( const Handle(Prs3d_Presentation)& Prs,
 
   if ( myUseTexture )
   {
-    Handle(AIS_Drawer) anAISDrawer =  myParentMesh->Attributes();
-    if ( anAISDrawer.IsNull() )
+    Handle(Prs3d_Drawer) aPrsDrawer =  myParentMesh->Attributes();
+    if ( aPrsDrawer.IsNull() )
       return;
 
-    anAISDrawer->SetShadingAspect( new Prs3d_ShadingAspect() );
-    anAsp = anAISDrawer->ShadingAspect()->Aspect();
+    aPrsDrawer->SetShadingAspect( new Prs3d_ShadingAspect() );
+    anAsp = aPrsDrawer->ShadingAspect()->Aspect();
     if ( anAsp.IsNull() )
       return;
 
index c48cb5c..6642590 100755 (executable)
@@ -7,3 +7,5 @@ Prs3d_DimensionUnits.hxx
 Prs3d_DimensionUnits.cxx
 Prs3d_PresentationShadow.hxx
 Prs3d_PresentationShadow.cxx
+Prs3d_Drawer.hxx
+Prs3d_Drawer.cxx
index 6a33d3e..1563502 100644 (file)
@@ -66,8 +66,8 @@ is
   ---Purpose: Declares types of hidden line removal algorithm.
   --          TOH_Algo enables using of exact HLR algorithm.
   --          TOH_PolyAlgo enables using of polygonal HLR algorithm.
-  --          TOH_NotSet is used by AIS_Drawer class, it means that the drawer should return the global value.
-  --          For more details see AIS_Drawer class, AIS_Shape::Compute() method and
+  --          TOH_NotSet is used by Prs3d_Drawer class, it means that the drawer should return the global value.
+  --          For more details see Prs3d_Drawer class, AIS_Shape::Compute() method and
   --          HLRAlgo package from TKHLR toolkit.
   
   enumeration DimensionTextHorizontalPosition is DTHP_Left, DTHP_Right, DTHP_Center, DTHP_Fit;
@@ -114,7 +114,7 @@ is
   class DatumAspect;
   imported DimensionUnits;
 
-  class Drawer;
+  imported transient class Drawer;
 
   class Projector;
 
diff --git a/src/Prs3d/Prs3d_Drawer.cdl b/src/Prs3d/Prs3d_Drawer.cdl
deleted file mode 100644 (file)
index 1bdfaab..0000000
+++ /dev/null
@@ -1,601 +0,0 @@
--- Created on: 1992-09-18
--- Created by: Jean Louis FRENKEL
--- Copyright (c) 1992-1999 Matra Datavision
--- Copyright (c) 1999-2014 OPEN CASCADE SAS
---
--- This file is part of Open CASCADE Technology software library.
---
--- This library is free software; you can redistribute it and/or modify it under
--- the terms of the GNU Lesser General Public License version 2.1 as published
--- by the Free Software Foundation, with special exception defined in the file
--- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
--- distribution for complete text of the license and disclaimer of any warranty.
---
--- Alternatively, this file may be used under the terms of Open CASCADE
--- commercial license or contractual agreement.
-
-class Drawer from Prs3d inherits TShared from MMgt
-
-       ---Purpose: A graphic attribute manager which governs how
-       -- objects such as color, width, line thickness and
-       -- deflection are displayed.
-       -- Prs3d_Drawer is the mother class of AIS_Drawer.
-       -- As such, it is its set functions which are called to
-       -- modify display parameters. In the example below we
-       -- can see that the AIS_Drawer is modified to set the
-       -- value of the deviation coefficient using a method
-       -- inherited from Prs3d_Drawer.
-      -- A drawer includes an instance of the Aspect classes
-      -- with particular default values.
-       
-uses
-    DatumAspect from Prs3d,
-    LineAspect from Prs3d,
-    TextAspect from Prs3d,
-    PointAspect from Prs3d,
-    ShadingAspect from Prs3d,
-    IsoAspect from Prs3d,
-    DimensionAspect from Prs3d,
-    PlaneAspect from Prs3d,
-    ArrowAspect from Prs3d,
-    TypeOfDeflection from Aspect,
-    NameOfColor from Quantity,
-    PlaneAngle from Quantity,
-    Length from Quantity,
-    TypeOfHLR from Prs3d,
-    DimensionUnits from Prs3d,
-    VertexDrawMode from Prs3d,
-    AsciiString from TCollection,
-    Ax2 from gp
-
-is
-    Create returns Drawer from Prs3d;
-
----Category: deviation definition.
--- 
--- All drawings of curves or patches are made with respect to a maximal 
--- chordial deviation. This deviation is absolute and given through
--- the method: SetMaximalChordialDeviation.
--- 
--- In the case of drawing shapes, it is allowed to ask for a relative
--- deviation.
--- This deviation will be: SizeOfObject * DeviationCoefficient where
--- DeviationCoefficient can be set through the method: SetDeviationCoefficient.
--- 
---
--- For drawing algorithms using discretisation, a default number of
--- points has been set to 17. It is possible to use the method SetDiscret
--- to change this number.
---
-
-
-    SetTypeOfDeflection (me:mutable; 
-                       aTypeOfDeflection: TypeOfDeflection from  Aspect)  
-       ---Purpose: Sets the type of chordal deflection.
-       -- This indicates whether the deflection value is absolute
-       -- or relative to the size of the object.         
-    is virtual;
-    
-    TypeOfDeflection(me) returns TypeOfDeflection from Aspect
-    is virtual;
-       --- Purpose: Returns the type of chordal deflection.
-       -- This indicates whether the deflection value is absolute
-       -- or relative to the size of the object.   
-    
-    SetMaximalChordialDeviation (me: mutable; 
-                              aChordialDeviation: Length from Quantity)
-       ---Purpose: Defines the maximal chordial deviation when drawing any curve;
-       --          Even if the type of deviation is set to TOD_Relative,
-       --          this value is used by:
-       --          
-       --                   Prs3d_DeflectionCurve
-       --                   Prs3d_WFDeflectionSurface
-       --                   Prs3d_WFDeflectionRestrictedFace
-    is virtual;
-    
-    MaximalChordialDeviation (me) returns Length from Quantity
-       ---Purpose: returns the maximal chordial deviation. Default value is 0.1
-    is virtual;
-           
-    SetDeviationCoefficient(me: mutable; aCoefficient: Real from Standard)
-       ---Purpose: Sets the deviation coefficient aCoefficient.
-    is virtual;
-
-    DeviationCoefficient(me) returns Real from Standard 
-    is virtual;
-       ---Purpose: Returns the deviation coefficient.
-    SetHLRDeviationCoefficient(me: mutable; aCoefficient: Real from Standard)
-       ---Purpose: Sets the deviation coefficient aCoefficient for removal
-       -- of hidden lines created by different viewpoints in
-       -- different presentations. The Default value is 0.02.
-    is virtual;
-
-    HLRDeviationCoefficient(me) returns Real from Standard 
-    is virtual;
-       ---Purpose: Returns the real number value of the hidden line
-       -- removal deviation coefficient.   
-    SetHLRAngle(me: mutable; anAngle: Real from Standard)
-       ---Purpose: Sets anAngle, the angle of maximum chordal
-       -- deviation for removal of hidden lines created by
-       -- different viewpoints in different presentations. The
-       -- default value is 20*PI/180.
-    is virtual;
-
-    HLRAngle(me) returns Real from Standard 
-    is virtual;
-       ---Purpose: Returns the real number value of the deviation angle
-       -- in hidden line removal views. The default value is 20*PI/180.
-    
-    SetDeviationAngle(me: mutable; anAngle: Real from Standard)
-       ---Purpose: Sets deviation angle
-    is virtual;
-
-    DeviationAngle(me) returns Real from Standard
-       ---Purpose: Returns the value for deviation angle.
-    is virtual;
-
-    SetDiscretisation(me: mutable; d: Integer from Standard)
-       ---Purpose: Sets the discretisation parameter d.
-    is virtual;
-
-    Discretisation(me) returns Integer from Standard
-    is virtual;
-       ---Purpose: Returns the discretisation setting.
-    SetMaximalParameterValue(me: mutable; Value: Real from Standard)
-       ---Purpose: defines the maximum value allowed  for the first and last
-       --          parameters of an infinite curve. Default value: 500. 
-    is virtual;
-    
-    MaximalParameterValue(me) returns Real from Standard
-    is virtual;
-       --- Purpose: Sets the maximum value allowed for the first and last
-       -- parameters of an infinite curve. By default, this value is 500000. 
-
-    SetIsoOnPlane (me: mutable; OnOff: Boolean from Standard)
-       ---Purpose: Sets IsoOnPlane on or off   by setting the parameter
-       -- OnOff to true or false.
-    is virtual;
-    
-    IsoOnPlane(me) returns Boolean from Standard 
-       ---Purpose: Returns True if the drawing of isos on planes is enabled.
-    is virtual;
-    
-    SetTypeOfHLR(me: mutable; theTypeOfHLR: TypeOfHLR from Prs3d)
-    is virtual;
-    ---Purpose: Sets the type of HLR algorithm
-    --          used by drawer's interactive objects
-    
-    TypeOfHLR(me) returns TypeOfHLR from Prs3d
-    is virtual;
-     ---Purpose: Gets the myTypeOfHLR value
-
-
--- 
--- Attributes for the U Isoparametric lines of patches.
---    
-    UIsoAspect (me:mutable) returns IsoAspect from Prs3d
-       ---Purpose: 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
-       --          
-       --         
-       --          These attributes are used by the following algorithms:
-       --          Prs3d_WFDeflectionSurface 
-       --          Prs3d_WFDeflectionRestrictedFace
-
-
-    is virtual;    
-    
-    SetUIsoAspect (me:mutable; anAspect: IsoAspect from Prs3d) 
-    is virtual;
-
--- Attributes for the V Isoparametric line of patches.
-
-
-    VIsoAspect (me:mutable) returns IsoAspect from Prs3d
-       ---Purpose: 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
-       --          
-       --         
-       --          These attributes are used by the following algorithms:
-       --          Prs3d_WFDeflectionSurface 
-       --          Prs3d_WFDeflectionRestrictedFace
-    is virtual;    
-    
-    SetVIsoAspect (me:mutable;anAspect: IsoAspect from Prs3d)
-    is virtual;
-       ---Purpose: Sets the appearance of V isoparameters - anAspect.
-
-    FreeBoundaryAspect (me:mutable) returns LineAspect from Prs3d
-       ---Purpose:  Stores 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.
-       --          These attributes are used by the algorithm Prs3d_WFShape
-    is virtual;
-    
-    SetFreeBoundaryAspect(me:mutable;anAspect: LineAspect from Prs3d)
-    is virtual;
-       --- Purpose: Sets the parameter anAspect for the display of free boundaries.
-    
-    SetFreeBoundaryDraw (me: mutable; OnOff: Boolean from Standard)
-       ---Purpose: Sets free boundary drawing on or off by setting the
-       -- parameter OnOff to true or false.
-    
-    is virtual;
-    
-    FreeBoundaryDraw(me) returns Boolean from Standard 
-       ---Purpose: Returns True if the drawing of the shared boundaries
-       -- is disabled. True is the default setting.
-    is virtual;
-    
-
--- Attributes for the wires
-
-    WireAspect (me:mutable) returns LineAspect from Prs3d
-       ---Purpose: Returns wire aspect settings.
-       --          The LineAspect for the wire can be edited.
-       --          The default values are:
-       --          Color: Quantity_NOC_RED
-       --          Type of line: Aspect_TOL_SOLID
-       --          Width: 1.           
-       --          These attributes are used by the algorithm Prs3d_WFShape
-    is virtual;    
-
-    SetWireAspect(me:mutable;anAspect: LineAspect from Prs3d)
-    is virtual;
-
-       --- Purpose: Sets the parameter anAspect for display of wires.
-        
-    SetWireDraw (me: mutable; OnOff: Boolean from Standard)
-       ---Purpose: Sets WireDraw on or off   by setting the parameter
-       -- OnOff to true or false.
-    
-    is virtual;
-    
-    WireDraw(me) returns Boolean from Standard 
-       ---Purpose: returns True if the drawing of the wire is enabled.
-    is virtual;
-    
-
--- Attributes for the unfree boundaries
-
-    UnFreeBoundaryAspect (me:mutable) returns LineAspect from Prs3d
-       ---Purpose: 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.
-       --          These attributes are used by the algorithm Prs3d_WFShape
-    is virtual;
-
-    SetUnFreeBoundaryAspect(me:mutable; anAspect: LineAspect from Prs3d)
-    is virtual;
-       --- Purpose: Sets the parameter anAspect for the display of shared boundaries.   
-    SetUnFreeBoundaryDraw (me: mutable; OnOff: Boolean from Standard)
-       ---Purpose: Sets FreeBoundaryDraw on or off by setting the
-       -- parameter OnOff to true or false.
-        --          By default the unfree boundaries  are drawn.
-    
-    is virtual;
-    
-    UnFreeBoundaryDraw(me) returns Boolean from Standard 
-       ---Purpose: Returns True if the drawing of the shared boundaries is enabled.
-       -- True is the default setting.
-    is virtual;
-    
-
--- 
---  Attributes for the lines.
--- 
-
-    LineAspect(me:mutable) returns LineAspect from Prs3d
-       ---Purpose:   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.
-       --          These attributes are used by the following algorithms:
-       --          Prs3d_Curve
-       --          Prs3d_Line
-       --          Prs3d_HLRShape
-
-    is virtual;
-    
-    SetLineAspect(me:mutable; anAspect: LineAspect from Prs3d)
-    is virtual;
-       --- Purpose: Sets the parameter anAspect for display attributes of lines.
-
-    TextAspect(me:mutable) returns TextAspect from Prs3d
-       --- Purpose: Returns settings for text aspect.
-       -- These settings can be edited. The default value is:
-       -- -   Color: Quantity_NOC_YELLOW
-  
-    is virtual;
-    
-    SetTextAspect(me:mutable; anAspect: TextAspect from Prs3d)
-    is virtual;
-       --- Purpose: Sets the parameter anAspect for display attributes of text.   
-    
-    SetLineArrowDraw (me: mutable; OnOff: Boolean from Standard)
-       ---Purpose: enables the drawing of an arrow at the end of each line.
-       --          By default the arrows are not drawn.
-    
-    is virtual;
-    
-    LineArrowDraw(me) returns Boolean from Standard 
-      ---Purpose: Returns True if drawing an arrow at the end of each edge is enabled
-      -- and False otherwise (the default).
-    is virtual;
-    
-    ArrowAspect(me:mutable) returns ArrowAspect from Prs3d 
-    is virtual;
-       ---Purpose: Returns the attributes for display of arrows.    
-    
-    SetArrowAspect(me:mutable; anAspect: ArrowAspect from Prs3d)
-    is virtual ;
-       ---Purpose: Sets the parameter anAspect for display attributes of arrows.
-        
-    PointAspect(me:mutable) returns PointAspect from Prs3d
-       ---Purpose: Returns the point aspect setting. The default values are
-       --        Color: Quantity_NOC_YELLOW
-       --          Type of marker: Aspect_TOM_PLUS
-       --          Scale: 1.          
-       --          These attributes are used by the algorithms Prs3d_Point.
-    is virtual;
-    
-    SetPointAspect(me:mutable; anAspect: PointAspect from Prs3d) 
-    is virtual;
-       --- Purpose: Sets the parameter anAspect for display attributes of points
-
-    SetVertexDrawMode(me: mutable; theMode: VertexDrawMode from Prs3d)
-      ---Purpose: 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,
-      -- that corresponds to <b>Prs3d_VDM_Standalone</b> mode.
-      -- Switching to <b>Prs3d_VDM_Standalone</b> mode makes all shape's vertices visible.
-      -- To inherit this parameter from the global drawer instance ("the link") when it is present,
-      -- <b>Prs3d_VDM_Inherited</b> value should be used.
-    is virtual;
-
-    VertexDrawMode(me) returns VertexDrawMode from Prs3d
-      ---Purpose: Returns the current mode of visualization of vertices of a TopoDS_Shape instance.
-    is virtual;
-        
-    ShadingAspect (me:mutable) returns ShadingAspect from Prs3d
-   is virtual;
-       ---Purpose: Returns settings for shading aspects.
-       -- These settings can be edited. The default values are:
-       -- -   Color: Quantity_NOC_YELLOW
-       -- -   Material: Graphic3d_NOM_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.
-    
-
-    SetShadingAspect(me:mutable; anAspect: ShadingAspect from Prs3d) 
-    is virtual;
-       ---Purpose: Sets the parameter anAspect for display attributes of shading.
-        
-    SetShadingAspectGlobal(me: mutable; aValue: Boolean from Standard) 
-       ---Purpose: indicates that the ShadingAspect will be apply
-       --          to the whole presentation. This allows to modify
-       --          the aspect without recomputing the content of the presentation.
-    is virtual;
-    
-    ShadingAspectGlobal(me) returns Boolean from Standard
-    is virtual;  
---
---  Attributes for hidden lines removal. These attributes are used when
---  using an algorithm such Prs3d_HLRShape for example.
---  
-
-    DrawHiddenLine(me) returns Boolean from Standard 
-       ---Purpose: returns Standard_True if the hidden lines are to be drawn.
-       --          By default the hidden lines are not drawn.
-    is virtual;
-    
-    EnableDrawHiddenLine(me: mutable)
-       ---Purpose: Enables the DrawHiddenLine function.
-    is virtual;
-
-    DisableDrawHiddenLine(me: mutable)
-       ---Purpose:  Disables the DrawHiddenLine function.
-    is virtual;
-
-    HiddenLineAspect(me:mutable) returns LineAspect from Prs3d
-       ---Purpose: 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.
-    is virtual;
-
-    SetHiddenLineAspect(me:mutable; anAspect: LineAspect from Prs3d) 
-    is virtual;
-       ---Purpose: Sets the parameter anAspect for the display of
-       -- hidden lines in hidden line removal mode.   
-    
-    SeenLineAspect(me:mutable) returns LineAspect from Prs3d
-       ---Purpose: 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.
-    is virtual;
-
-    SetSeenLineAspect(me:mutable; anAspect: LineAspect from Prs3d) 
-    is virtual;
-       --- Purpose: Sets the parameter anAspect for the display of seen
-       -- lines in hidden line removal mode.
-
-    PlaneAspect(me:mutable) returns PlaneAspect from Prs3d
-    is virtual;
-       ---Purpose: Returns settings for the appearance of planes.
-    
-    SetPlaneAspect(me:mutable; anAspect: PlaneAspect from Prs3d)
-    is virtual;
-       ---Purpose: Sets the parameter anAspect for the display of planes.
-
-    VectorAspect(me:mutable) returns LineAspect from Prs3d
-       ---Purpose: 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.
-    is virtual;
-
-    SetVectorAspect(me:mutable; anAspect: LineAspect from Prs3d) 
-    is virtual;
-       ---Purpose: Sets the modality anAspect for the display of vectors.    
-
---
---  Attributes for the presentation of a Datum.
---  
-
-    DatumAspect(me:mutable) returns DatumAspect from Prs3d
-       ---Purpose: 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.
-    is virtual;
-
-    SetDatumAspect(me:mutable; anAspect: DatumAspect from Prs3d)
-    is virtual;
-       ---Purpose: Sets the modality anAspect for the display of datums.
-
-    DimensionAspect(me:mutable) returns DimensionAspect from Prs3d is virtual;
-    ---Purpose: Returns settings for the appearance of dimensions.
-
-    SetDimensionAspect(me:mutable; theAspect: DimensionAspect from Prs3d) is virtual;
-    ---Purpose: Sets the settings for the appearance of dimensions.
-
-    SetDimLengthModelUnits (me: mutable; theUnits : AsciiString from TCollection) is virtual;
-    ---Purpose: Sets dimension length model units for computing of dimension presentation.
-
-    SetDimAngleModelUnits (me: mutable; theUnits : AsciiString from TCollection) is virtual;
-    ---Purpose: Sets dimension angle model units for computing of dimension presentation.
-
-    DimLengthModelUnits (me) returns AsciiString from TCollection is virtual;
-    ---Purpose: Returns length model units for the dimension presentation.
-    ---C++: return const &
-
-    DimAngleModelUnits (me) returns AsciiString from TCollection is virtual;
-    ---Purpose: Returns angle model units for the dimension presentation.
-    ---C++: return const &
-
-    SetDimLengthDisplayUnits (me: mutable; theUnits : AsciiString from TCollection) is virtual;
-    ---Purpose: Sets length units in which value for dimension presentation is displayed.
-
-    SetDimAngleDisplayUnits (me: mutable; theUnits : AsciiString from TCollection) is virtual;
-    ---Purpose: Sets angle units in which value for dimension presentation is displayed.
-
-    DimLengthDisplayUnits (me) returns AsciiString from TCollection is virtual;
-    ---Purpose: Returns length units in which dimension presentation is displayed.
-    ---C++: return const &
-
-    DimAngleDisplayUnits (me) returns AsciiString from TCollection is virtual;
-    ---Purpose: Returns angle units in which dimension presentation is displayed.
-    ---C++: return const &
-
-    SectionAspect (me : mutable) returns LineAspect from Prs3d is virtual;
-    ---Purpose: The LineAspect for the wire can be edited.
-    --          The default values are:
-    --          Color: Quantity_NOC_ORANGE
-    --          Type of line: Aspect_TOL_SOLID
-    --          Width: 1.
-    --          These attributes are used by the algorithm Prs3d_WFShape.
-
-    SetSectionAspect (me : mutable; theAspect: LineAspect from Prs3d) is virtual;
-    ---Purpose: Sets the parameter theAspect for display attributes of sections.
-
-    SetFaceBoundaryDraw (me           : mutable;
-                         theIsEnabled : Boolean from Standard)
-    is virtual;
-        ---Purpose: Enables or disables face boundary drawing for shading presentations.
-        -- theIsEnabled is a boolean flag indicating whether the face boundaries should be
-        -- drawn or not.
-
-    IsFaceBoundaryDraw (me) returns Boolean from Standard
-    is virtual;
-        ---Purpose: Checks whether the face boundary drawing is enabled or not.
-
-    SetFaceBoundaryAspect (me        : mutable;
-                           theAspect : LineAspect from Prs3d)
-    is virtual;
-        ---Purpose: Sets line aspect for face boundaries.
-        -- theAspect is the line aspect that determines the look of the face boundaries.
-
-    FaceBoundaryAspect (me : mutable) returns LineAspect from Prs3d
-    is virtual;
-        ---Purpose: Returns line aspect of face boundaries.
-
-fields
-
-    myUIsoAspect: IsoAspect from Prs3d is protected;
-    myVIsoAspect: IsoAspect from Prs3d is protected;
-    myNbPoints  : Integer   from Standard is protected;
-    myIsoOnPlane: Boolean from Standard is protected;
-    myFreeBoundaryAspect: LineAspect from Prs3d is protected;
-    myFreeBoundaryDraw: Boolean from Standard is protected;
-    myUnFreeBoundaryAspect: LineAspect from Prs3d is protected;
-    myUnFreeBoundaryDraw: Boolean from Standard is protected;
-    myWireAspect: LineAspect from Prs3d is protected;
-    myWireDraw: Boolean from Standard is protected;
-    myLineAspect: LineAspect from Prs3d is protected;
-    myTextAspect: TextAspect from Prs3d is protected;
-    myShadingAspect: ShadingAspect from Prs3d is protected;
-    myShadingAspectGlobal: Boolean from Standard is protected;
-    myChordialDeviation: Length from Quantity is protected;
-    myTypeOfDeflection: TypeOfDeflection from Aspect is protected;
-    myMaximalParameterValue: Real from Standard is protected;
-
-    myDeviationCoefficient: Real from Standard is protected;
-    myHLRDeviationCoefficient: Real from Standard is protected;
-
-    myDeviationAngle: Real from Standard is protected;
-    myHLRAngle:       Real from Standard is protected;
-
-    myPointAspect: PointAspect from Prs3d is protected;
-    myVertexDrawMode: VertexDrawMode from Prs3d is protected;
-    myPlaneAspect: PlaneAspect from Prs3d is protected;
-    myArrowAspect: ArrowAspect from Prs3d is protected;
-    myLineDrawArrow: Boolean from Standard is protected;
-    myDrawHiddenLine: Boolean from Standard is protected;
-    myHiddenLineAspect: LineAspect from Prs3d is protected;
-    mySeenLineAspect: LineAspect from Prs3d is protected;
-    myVectorAspect: LineAspect from Prs3d is protected;
-    myDatumAspect: DatumAspect from Prs3d is protected;
-    myDatumScale: Real from Standard is protected;
-
-    myDimensionAspect         : DimensionAspect from Prs3d is protected;
-    myDimensionModelUnits     : DimensionUnits from Prs3d is protected;
-    myDimensionDisplayUnits   : DimensionUnits from Prs3d is protected;
-
-    mySectionAspect       : LineAspect from Prs3d is protected;
-    myFaceBoundaryDraw    : Boolean from Standard is protected;
-    myFaceBoundaryAspect  : LineAspect from Prs3d is protected;
-    myTypeOfHLR           : TypeOfHLR from Prs3d is protected;
-
-end Drawer;
index f4c63f9..71b2a6e 100644 (file)
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#include <Prs3d_Drawer.ixx>
+#include <Prs3d_Drawer.hxx>
+#include <Prs3d_ArrowAspect.hxx>
+#include <Prs3d_DatumAspect.hxx>
+#include <Prs3d_DimensionAspect.hxx>
+#include <Prs3d_IsoAspect.hxx>
+#include <Prs3d_LineAspect.hxx>
+#include <Prs3d_PlaneAspect.hxx>
+#include <Prs3d_PointAspect.hxx>
+#include <Prs3d_ShadingAspect.hxx>
+#include <Prs3d_TextAspect.hxx>
+
+IMPLEMENT_STANDARD_HANDLE (Prs3d_Drawer, MMgt_TShared)
+IMPLEMENT_STANDARD_RTTIEXT(Prs3d_Drawer, MMgt_TShared)
 
 // =======================================================================
 // function : Prs3d_Drawer
 // purpose  :
 // =======================================================================
 Prs3d_Drawer::Prs3d_Drawer()
-: myNbPoints (30),
-  myIsoOnPlane (Standard_False),
-  myFreeBoundaryDraw (Standard_True),
-  myUnFreeBoundaryDraw (Standard_True),
-  myWireDraw (Standard_True),
-  myShadingAspect (new Prs3d_ShadingAspect()),
-  myShadingAspectGlobal (Standard_True),
-  myChordialDeviation (0.0001),
-  myTypeOfDeflection (Aspect_TOD_RELATIVE),
-  myMaximalParameterValue (500000.),
-  myDeviationCoefficient (0.001),
-  myHLRDeviationCoefficient (0.02),
-  myDeviationAngle (12.0 * M_PI / 180.0),
-  myHLRAngle (20.0 * M_PI / 180.0),
-  myVertexDrawMode (Prs3d_VDM_Isolated),
-  myLineDrawArrow (Standard_False),
-  myDrawHiddenLine (Standard_False),
-  myFaceBoundaryDraw (Standard_False),
-  myTypeOfHLR (Prs3d_TOH_PolyAlgo)
+: myNbPoints                      (30),
+  myHasOwnNbPoints                (Standard_False),
+  myMaximalParameterValue         (500000.),
+  myHasOwnMaximalParameterValue   (Standard_False),
+  myChordialDeviation             (0.0001),
+  myHasOwnChordialDeviation       (Standard_False),
+  myTypeOfDeflection              (Aspect_TOD_RELATIVE),
+  myHasOwnTypeOfDeflection        (Standard_False),
+  myTypeOfHLR                     (Prs3d_TOH_NotSet),
+  myDeviationCoefficient          (0.001),
+  myHasOwnDeviationCoefficient    (Standard_False),
+  myHLRDeviationCoefficient       (0.02),
+  myHasOwnHLRDeviationCoefficient (Standard_False),
+  myDeviationAngle                (12.0 * M_PI / 180.0),
+  myHasOwnDeviationAngle          (Standard_False),
+  myHLRAngle                      (20.0 * M_PI / 180.0),
+  myHasOwnHLRDeviationAngle       (Standard_False),
+  myIsoOnPlane                    (Standard_False),
+  myHasOwnIsoOnPlane              (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),
+  myShadingAspectGlobal       (Standard_True),
+  myHasOwnShadingAspectGlobal (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),
+  myHasOwnFaceBoundaryAspect   (Standard_False),
+  myFaceBoundaryDraw           (Standard_False),
+  myHasOwnFaceBoundaryDraw     (Standard_False),
+
+  myHasOwnDimensionAspect       (Standard_False),
+  myHasOwnDimLengthModelUnits   (Standard_False),
+  myHasOwnDimAngleModelUnits    (Standard_False),
+  myHasOwnDimLengthDisplayUnits (Standard_False),
+  myHasOwnDimAngleDisplayUnits  (Standard_False)
 {
   myDimensionModelUnits.SetLengthUnits ("m");
   myDimensionModelUnits.SetAngleUnits ("rad");
@@ -45,69 +97,100 @@ Prs3d_Drawer::Prs3d_Drawer()
   myDimensionDisplayUnits.SetAngleUnits ("deg");
 }
 
-void Prs3d_Drawer::SetTypeOfDeflection(const Aspect_TypeOfDeflection aTypeOfDeflection){
-
-  myTypeOfDeflection = aTypeOfDeflection;}
-
-Aspect_TypeOfDeflection Prs3d_Drawer::TypeOfDeflection() const {
-
-  return myTypeOfDeflection;
-
-}
+// =======================================================================
+// function : SetTypeOfDeflection
+// purpose  :
+// =======================================================================
 
-void Prs3d_Drawer::SetIsoOnPlane(const Standard_Boolean OnOff)
+void Prs3d_Drawer::SetTypeOfDeflection (const Aspect_TypeOfDeflection theTypeOfDeflection)
 {
-  myIsoOnPlane = OnOff;
+  myHasOwnTypeOfDeflection = Standard_True;
+  myTypeOfDeflection       = theTypeOfDeflection;
 }
 
-Standard_Boolean Prs3d_Drawer::IsoOnPlane()const
+// =======================================================================
+// function : SetMaximalChordialDeviation
+// purpose  :
+// =======================================================================
+
+void Prs3d_Drawer::SetMaximalChordialDeviation (const Quantity_Length theChordialDeviation)
 {
-  return myIsoOnPlane;
+  myHasOwnChordialDeviation = Standard_True;
+  myChordialDeviation       = theChordialDeviation;
 }
 
+// =======================================================================
+// function : SetTypeOfHLR
+// purpose  : set type of HLR algorithm
+// =======================================================================
 
-Standard_Integer Prs3d_Drawer::Discretisation() const
+void Prs3d_Drawer::SetTypeOfHLR (const Prs3d_TypeOfHLR theTypeOfHLR)
 {
-  return myNbPoints;
+  myTypeOfHLR = theTypeOfHLR;
 }
 
+// =======================================================================
+// function : TypeOfHLR
+// purpose  : gets type of HLR algorithm
+// =======================================================================
 
-void Prs3d_Drawer::SetDiscretisation(const Standard_Integer d) 
+Prs3d_TypeOfHLR Prs3d_Drawer::TypeOfHLR()
 {
-  myNbPoints = d;
+  if (!HasOwnTypeOfHLR())
+  {
+    if (!myLink.IsNull())
+    {
+      return myLink->TypeOfHLR();
+    }
+    // Prs3d_TOH_PolyAlgo is default value for this setting.
+    myTypeOfHLR = Prs3d_TOH_PolyAlgo;
+  }
+  return myTypeOfHLR;
 }
 
+// =======================================================================
+// function : SetMaximalParameterValue
+// purpose  :
+// =======================================================================
 
-void Prs3d_Drawer::SetMaximalChordialDeviation(
-                               const Quantity_Length aChordialDeviation) {
-  myChordialDeviation = aChordialDeviation;
+void Prs3d_Drawer::SetMaximalParameterValue (const Standard_Real theValue)
+{
+  myHasOwnMaximalParameterValue = Standard_True;
+  myMaximalParameterValue       = theValue;
 }
 
-Quantity_Length Prs3d_Drawer::MaximalChordialDeviation() const {
-  return myChordialDeviation;
-}
+// =======================================================================
+// function : SetIsoOnPlane
+// purpose  :
+// =======================================================================
 
-//
-//=======================================================================
-//function : SetDeviationCoefficient
-//purpose  : 
-//=======================================================================
+void Prs3d_Drawer::SetIsoOnPlane (const Standard_Boolean theIsEnabled)
+{
+  myHasOwnIsoOnPlane = Standard_True;
+  myIsoOnPlane       = theIsEnabled;
+}
 
-void Prs3d_Drawer::SetDeviationCoefficient (const Standard_Real aCoefficient) {
+// =======================================================================
+// function : SetDiscretisation
+// purpose  :
+// =======================================================================
 
-  myDeviationCoefficient = aCoefficient;
+void Prs3d_Drawer::SetDiscretisation (const Standard_Integer theValue) 
+{
+  myHasOwnNbPoints = Standard_True;
+  myNbPoints       = theValue;
 }
 
 //=======================================================================
-//function : DeviationCoefficient
+//function : SetDeviationCoefficient
 //purpose  : 
 //=======================================================================
 
-Standard_Real Prs3d_Drawer::DeviationCoefficient () const {
-
-  return myDeviationCoefficient;
+void Prs3d_Drawer::SetDeviationCoefficient (const Standard_Real theCoefficient)
+{
+  myPreviousDeviationCoefficient = DeviationCoefficient();
+  myDeviationCoefficient         = theCoefficient;
+  myHasOwnDeviationCoefficient   = Standard_True;
 }
 
 //=======================================================================
@@ -115,19 +198,23 @@ Standard_Real Prs3d_Drawer::DeviationCoefficient () const {
 //purpose  : 
 //=======================================================================
 
-void Prs3d_Drawer::SetHLRDeviationCoefficient (const Standard_Real aCoefficient) {
-
-  myHLRDeviationCoefficient = aCoefficient;
+void Prs3d_Drawer::SetHLRDeviationCoefficient (const Standard_Real theCoefficient)
+{
+  myPreviousHLRDeviationCoefficient = HLRDeviationCoefficient();
+  myHLRDeviationCoefficient         = theCoefficient;
+  myHasOwnHLRDeviationCoefficient   = Standard_True;
 }
 
 //=======================================================================
-//function : HLRDeviationCoefficient
+//function : SetDeviationAngle
 //purpose  : 
 //=======================================================================
 
-Standard_Real Prs3d_Drawer::HLRDeviationCoefficient () const {
-
-  return myHLRDeviationCoefficient;
+void Prs3d_Drawer::SetDeviationAngle (const Standard_Real theAngle)
+{
+  myPreviousDeviationAngle = DeviationAngle();
+  myDeviationAngle         = theAngle;
+  myHasOwnDeviationAngle   = Standard_True;
 }
 
 //=======================================================================
@@ -135,457 +222,823 @@ Standard_Real Prs3d_Drawer::HLRDeviationCoefficient () const {
 //purpose  : 
 //=======================================================================
 
-void Prs3d_Drawer::SetHLRAngle (const Standard_Real anAngle) {
-
-  myHLRAngle = anAngle;
+void Prs3d_Drawer::SetHLRAngle (const Standard_Real theAngle)
+{
+  myPreviousHLRDeviationAngle = HLRAngle();
+  myHLRAngle                  = theAngle;
+  myHasOwnHLRDeviationAngle   = Standard_True;
 }
 
-//=======================================================================
-//function : HLRAngle
-//purpose  : 
-//=======================================================================
-
-Standard_Real Prs3d_Drawer::HLRAngle () const {
+// =======================================================================
+// function : FreeBoundaryAspect
+// purpose  :
+// =======================================================================
 
-  return myHLRAngle;
+const Handle(Prs3d_LineAspect)& Prs3d_Drawer::FreeBoundaryAspect()
+{
+  if (!HasOwnFreeBoundaryAspect())
+  {
+    if (!myLink.IsNull())
+    {
+      return myLink->FreeBoundaryAspect();
+    }
+    if (myFreeBoundaryAspect.IsNull())
+    {
+      myFreeBoundaryAspect = new Prs3d_LineAspect (Quantity_NOC_GREEN, Aspect_TOL_SOLID, 1.0);
+    }
+  }
+  return myFreeBoundaryAspect;
 }
 
-//=======================================================================
-//function : SetDeviationAngle
-//purpose  : 
-//=======================================================================
+// =======================================================================
+// function : FreeBoundaryAspect
+// purpose  :
+// =======================================================================
 
-void Prs3d_Drawer::SetDeviationAngle (const Standard_Real anAngle)
+void Prs3d_Drawer::SetFreeBoundaryAspect (const Handle(Prs3d_LineAspect)& theAspect)
 {
-  myDeviationAngle = anAngle;
+  myFreeBoundaryAspect = theAspect;
+  myHasOwnFreeBoundaryAspect = !myFreeBoundaryAspect.IsNull();
 }
 
-//=======================================================================
-//function : DeviationAngle
-//purpose  : 
-//=======================================================================
+// =======================================================================
+// function : SetFreeBoundaryDraw
+// purpose  :
+// =======================================================================
 
-Standard_Real Prs3d_Drawer::DeviationAngle () const 
+void Prs3d_Drawer::SetFreeBoundaryDraw (const Standard_Boolean theIsEnabled)
 {
-  return myDeviationAngle;
+  myHasOwnFreeBoundaryDraw = Standard_True;
+  myFreeBoundaryDraw       = theIsEnabled;
 }
 
+// =======================================================================
+// function : UnFreeBoundaryAspect
+// purpose  :
+// =======================================================================
 
-void Prs3d_Drawer::SetMaximalParameterValue (const Standard_Real Value) {
-  myMaximalParameterValue = Value;
-}
-
-Standard_Real Prs3d_Drawer::MaximalParameterValue () const {
-  return myMaximalParameterValue;
+const Handle(Prs3d_LineAspect)& Prs3d_Drawer::UnFreeBoundaryAspect()
+{
+  if (!HasOwnUnFreeBoundaryAspect())
+  {
+    if (!myLink.IsNull())
+    {
+      return myLink->UnFreeBoundaryAspect();
+    }
+    if (myUnFreeBoundaryAspect.IsNull())
+    {
+      myUnFreeBoundaryAspect = new Prs3d_LineAspect (Quantity_NOC_YELLOW, Aspect_TOL_SOLID, 1.0);
+    }
+  }
+  return myUnFreeBoundaryAspect;
 }
 
-Handle (Prs3d_IsoAspect) Prs3d_Drawer::UIsoAspect (){
-
-  if (myUIsoAspect.IsNull()) 
-    myUIsoAspect = new Prs3d_IsoAspect
-                   (Quantity_NOC_GRAY75,Aspect_TOL_SOLID,0.5,1);
-
-  return myUIsoAspect;
-}
+// =======================================================================
+// function : SetUnFreeBoundaryAspect
+// purpose  :
+// =======================================================================
 
-void Prs3d_Drawer::SetUIsoAspect ( const Handle(Prs3d_IsoAspect)& anAspect) {
- myUIsoAspect = anAspect;
+void Prs3d_Drawer::SetUnFreeBoundaryAspect (const Handle(Prs3d_LineAspect)& theAspect)
+{
+  myUnFreeBoundaryAspect = theAspect;
+  myHasOwnUnFreeBoundaryAspect = !myUnFreeBoundaryAspect.IsNull();
 }
 
-Handle (Prs3d_IsoAspect) Prs3d_Drawer::VIsoAspect () {
-  if (myVIsoAspect.IsNull()) 
-    myVIsoAspect = new Prs3d_IsoAspect
-      (Quantity_NOC_GRAY75,Aspect_TOL_SOLID,0.5,1);
-      
-  return myVIsoAspect;
-}
+// =======================================================================
+// function : SetUnFreeBoundaryDraw
+// purpose  :
+// =======================================================================
 
-void Prs3d_Drawer::SetVIsoAspect ( const Handle(Prs3d_IsoAspect)& anAspect) {
- myVIsoAspect = anAspect;
+void Prs3d_Drawer::SetUnFreeBoundaryDraw (const Standard_Boolean theIsEnabled)
+{
+  myHasOwnUnFreeBoundaryDraw = Standard_True;
+  myUnFreeBoundaryDraw       = theIsEnabled;
 }
 
-Handle (Prs3d_LineAspect) Prs3d_Drawer::FreeBoundaryAspect () {
-  if (myFreeBoundaryAspect.IsNull())
-    myFreeBoundaryAspect = new Prs3d_LineAspect
-      (Quantity_NOC_GREEN,Aspect_TOL_SOLID,1.);
-
-  return myFreeBoundaryAspect;
-}
+// =======================================================================
+// function : FaceBoundaryAspect
+// purpose  :
+// =======================================================================
 
-void Prs3d_Drawer::SetFreeBoundaryAspect (const Handle(Prs3d_LineAspect)& anAspect) {
- myFreeBoundaryAspect = anAspect;
+const Handle(Prs3d_LineAspect)& Prs3d_Drawer::FaceBoundaryAspect()
+{
+  if (!HasOwnFaceBoundaryAspect())
+  {
+    if (!myLink.IsNull())
+    {
+      return myLink->FaceBoundaryAspect();
+    }
+    if (myFaceBoundaryAspect.IsNull())
+    {
+      myFaceBoundaryAspect = new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0);
+    }
+  }
+  return myFaceBoundaryAspect;
 }
 
-void Prs3d_Drawer::SetFreeBoundaryDraw ( const Standard_Boolean OnOff ) {
-  myFreeBoundaryDraw = OnOff;
-}
+// =======================================================================
+// function : SetFaceBoundaryAspect
+// purpose  :
+// =======================================================================
 
-Standard_Boolean Prs3d_Drawer::FreeBoundaryDraw () const {
-return myFreeBoundaryDraw;
+void Prs3d_Drawer::SetFaceBoundaryAspect (const Handle(Prs3d_LineAspect)& theAspect)
+{
+  myFaceBoundaryAspect = theAspect;
+  myHasOwnFaceBoundaryAspect = !myFaceBoundaryAspect.IsNull();
 }
 
-Handle (Prs3d_LineAspect) Prs3d_Drawer::UnFreeBoundaryAspect (){
-  if  (myUnFreeBoundaryAspect.IsNull())
-    myUnFreeBoundaryAspect = new Prs3d_LineAspect
-      (Quantity_NOC_YELLOW,Aspect_TOL_SOLID,1.);
-  return myUnFreeBoundaryAspect;
-}
+// =======================================================================
+// function : SetFaceBoundaryDraw
+// purpose  :
+// =======================================================================
 
-void Prs3d_Drawer::SetUnFreeBoundaryAspect ( const Handle(Prs3d_LineAspect)& anAspect) {
- myUnFreeBoundaryAspect = anAspect;
+void Prs3d_Drawer::SetFaceBoundaryDraw (const Standard_Boolean theIsEnabled)
+{
+  myHasOwnFaceBoundaryDraw = Standard_True;
+  myFaceBoundaryDraw       = theIsEnabled;
 }
 
-void Prs3d_Drawer::SetUnFreeBoundaryDraw ( const Standard_Boolean OnOff ) {
-  myUnFreeBoundaryDraw = OnOff;
-}
+// =======================================================================
+// function : DimensionAspect
+// purpose  :
+// =======================================================================
 
-Standard_Boolean Prs3d_Drawer::UnFreeBoundaryDraw () const {
-  return myUnFreeBoundaryDraw;
+const Handle(Prs3d_DimensionAspect)& Prs3d_Drawer::DimensionAspect()
+{
+  if (!HasOwnDimensionAspect())
+  {
+    if (!myLink.IsNull())
+    {
+      return myLink->DimensionAspect();
+    }
+    if (myDimensionAspect.IsNull())
+    {
+      myDimensionAspect = new Prs3d_DimensionAspect;
+    }
+  }
+  return myDimensionAspect;
 }
 
-Handle (Prs3d_LineAspect) Prs3d_Drawer::WireAspect ()  {
-  if (myWireAspect.IsNull())
-   myWireAspect = new Prs3d_LineAspect(Quantity_NOC_RED,Aspect_TOL_SOLID,1.);
+// =======================================================================
+// function : SetDimensionAspect
+// purpose  :
+// =======================================================================
 
-  return myWireAspect;
+void Prs3d_Drawer::SetDimensionAspect (const Handle(Prs3d_DimensionAspect)& theAspect)
+{
+  myDimensionAspect = theAspect;
+  myHasOwnDimensionAspect = !myDimensionAspect.IsNull();
 }
 
-void Prs3d_Drawer::SetWireAspect ( const Handle(Prs3d_LineAspect)& anAspect) {
- myWireAspect = anAspect;
-}
-void Prs3d_Drawer::SetWireDraw ( const Standard_Boolean OnOff ) {
-  myWireDraw = OnOff;
-}
+// =======================================================================
+// function : SetDimLengthModelUnits
+// purpose  :
+// =======================================================================
 
-Standard_Boolean Prs3d_Drawer::WireDraw () const {
-return myWireDraw;
+void Prs3d_Drawer::SetDimLengthModelUnits (const TCollection_AsciiString& theUnits)
+{
+  myHasOwnDimLengthModelUnits = Standard_True;
+  myDimensionModelUnits.SetLengthUnits (theUnits);
 }
 
+// =======================================================================
+// function : SetDimAngleModelUnits
+// purpose  :
+// =======================================================================
 
-Handle (Prs3d_LineAspect) Prs3d_Drawer::LineAspect ()  {
-  if (myLineAspect.IsNull())
-    myLineAspect = new Prs3d_LineAspect
-      (Quantity_NOC_YELLOW,Aspect_TOL_SOLID,1.);
-  return myLineAspect;
+void Prs3d_Drawer::SetDimAngleModelUnits (const TCollection_AsciiString& theUnits)
+{
+  myHasOwnDimAngleModelUnits = Standard_True;
+  myDimensionModelUnits.SetAngleUnits (theUnits);
 }
 
-void Prs3d_Drawer::SetLineAspect ( const Handle(Prs3d_LineAspect)& anAspect) {
- myLineAspect = anAspect;
+// =======================================================================
+// function : SetDimLengthDisplayUnits
+// purpose  :
+// =======================================================================
+
+void Prs3d_Drawer::SetDimLengthDisplayUnits (const TCollection_AsciiString& theUnits)
+{
+  myHasOwnDimLengthDisplayUnits = Standard_True;
+  myDimensionDisplayUnits.SetLengthUnits (theUnits);
 }
 
-Handle (Prs3d_TextAspect) Prs3d_Drawer::TextAspect ()  {
-  if (myTextAspect.IsNull())
-    myTextAspect = new Prs3d_TextAspect();
+// =======================================================================
+// function : SetDimAngleDisplayUnits
+// purpose  :
+// =======================================================================
 
-  return myTextAspect;
+void Prs3d_Drawer::SetDimAngleDisplayUnits (const TCollection_AsciiString& theUnits)
+{
+  myHasOwnDimAngleDisplayUnits = Standard_True;
+  myDimensionDisplayUnits.SetAngleUnits (theUnits);
 }
 
-void Prs3d_Drawer::SetTextAspect ( const Handle(Prs3d_TextAspect)& anAspect) {
- myTextAspect = anAspect;
+// =======================================================================
+// function : UIsoAspect
+// purpose  :
+// =======================================================================
+
+const Handle(Prs3d_IsoAspect)& Prs3d_Drawer::UIsoAspect()
+{
+  if (!HasOwnUIsoAspect())
+  {
+    if (!myLink.IsNull())
+    {
+      return myLink->UIsoAspect();
+    }
+    if (myUIsoAspect.IsNull())
+    {
+      myUIsoAspect = new Prs3d_IsoAspect (Quantity_NOC_GRAY75, Aspect_TOL_SOLID, 0.5, 1);
+    }
+  }
+  return myUIsoAspect;
 }
 
-Handle (Prs3d_ShadingAspect) Prs3d_Drawer::ShadingAspect ()  {
-  if (myShadingAspect.IsNull())
-  myShadingAspect = new Prs3d_ShadingAspect();
+// =======================================================================
+// function : SetUIsoAspect
+// purpose  :
+// =======================================================================
 
-  return myShadingAspect;
+void Prs3d_Drawer::SetUIsoAspect (const Handle(Prs3d_IsoAspect)& theAspect)
+{
+  myUIsoAspect = theAspect;
+  myHasOwnUIsoAspect = !myUIsoAspect.IsNull();
 }
 
-void Prs3d_Drawer::SetShadingAspect ( const Handle(Prs3d_ShadingAspect)& anAspect) {
- myShadingAspect = anAspect;
-}
+// =======================================================================
+// function : VIsoAspect
+// purpose  :
+// =======================================================================
 
-void Prs3d_Drawer::SetShadingAspectGlobal(const Standard_Boolean aValue) {
- myShadingAspectGlobal = aValue;
+const Handle(Prs3d_IsoAspect)& Prs3d_Drawer::VIsoAspect()
+{
+  if (!HasOwnVIsoAspect())
+  {
+    if (!myLink.IsNull())
+    {
+      return myLink->VIsoAspect();
+    }
+    if (myVIsoAspect.IsNull())
+    {
+      myVIsoAspect = new Prs3d_IsoAspect (Quantity_NOC_GRAY75, Aspect_TOL_SOLID, 0.5, 1);
+    }
+  }
+  return myVIsoAspect;
 }
 
-Standard_Boolean Prs3d_Drawer::ShadingAspectGlobal() const { 
- return myShadingAspectGlobal;
+// =======================================================================
+// function : SetVIsoAspect
+// purpose  :
+// =======================================================================
 
+void Prs3d_Drawer::SetVIsoAspect (const Handle(Prs3d_IsoAspect)& theAspect)
+{
+  myVIsoAspect = theAspect;
+  myHasOwnVIsoAspect= !myVIsoAspect.IsNull();
 }
-void Prs3d_Drawer::SetLineArrowDraw ( const Standard_Boolean OnOff ) {
-  myLineDrawArrow = OnOff;
-}
 
-Standard_Boolean Prs3d_Drawer::LineArrowDraw () const {
-return myLineDrawArrow;
+// =======================================================================
+// function : WireAspect
+// purpose  :
+// =======================================================================
+
+const Handle(Prs3d_LineAspect)& Prs3d_Drawer::WireAspect()
+{
+  if (!HasOwnWireAspect())
+  {
+    if (!myLink.IsNull())
+    {
+      return myLink->WireAspect();
+    }
+    if (myWireAspect.IsNull())
+    {
+      myWireAspect = new Prs3d_LineAspect (Quantity_NOC_RED, Aspect_TOL_SOLID, 1.0);
+    }
+  }
+  return myWireAspect;
 }
 
-Handle (Prs3d_ArrowAspect) Prs3d_Drawer::ArrowAspect() {
-  if (myArrowAspect.IsNull())
-    myArrowAspect = new Prs3d_ArrowAspect;
+// =======================================================================
+// function : SetWireAspect
+// purpose  :
+// =======================================================================
 
-  return myArrowAspect;
+void Prs3d_Drawer::SetWireAspect (const Handle(Prs3d_LineAspect)& theAspect)
+{
+  myWireAspect = theAspect;
+  myHasOwnWireAspect = !myWireAspect.IsNull();
 }
 
-void Prs3d_Drawer::SetArrowAspect ( const Handle(Prs3d_ArrowAspect)& anAspect) {
- myArrowAspect = anAspect;
+// =======================================================================
+// function : SetWireDraw
+// purpose  :
+// =======================================================================
+
+void Prs3d_Drawer::SetWireDraw (const Standard_Boolean theIsEnabled)
+{
+  myHasOwnWireDraw = Standard_True;
+  myWireDraw       = theIsEnabled;
 }
 
-Handle (Prs3d_PointAspect) Prs3d_Drawer::PointAspect() {
-  if (myPointAspect.IsNull())
-    myPointAspect = new Prs3d_PointAspect 
-      (Aspect_TOM_PLUS,Quantity_NOC_YELLOW,1.);
+// =======================================================================
+// function : PointAspect
+// purpose  :
+// =======================================================================
 
+const Handle(Prs3d_PointAspect)& Prs3d_Drawer::PointAspect()
+{
+  if (!HasOwnPointAspect())
+  {
+    if (!myLink.IsNull())
+    {
+      return myLink->PointAspect();
+    }
+    if (myPointAspect.IsNull())
+    {
+      myPointAspect = new Prs3d_PointAspect (Aspect_TOM_PLUS, Quantity_NOC_YELLOW, 1.0);
+    }
+  }
   return myPointAspect;
 }
 
-void Prs3d_Drawer::SetPointAspect ( const Handle(Prs3d_PointAspect)& anAspect) {
- myPointAspect = anAspect;
-}
+// =======================================================================
+// function : SetPointAspect
+// purpose  :
+// =======================================================================
 
-void Prs3d_Drawer::SetVertexDrawMode (const Prs3d_VertexDrawMode theMode)
+void Prs3d_Drawer::SetPointAspect (const Handle(Prs3d_PointAspect)& theAspect)
 {
-  // Prs3d_VDM_Inherited value is allowed at AIS_Drawer level.
-  // Replacing it by Prs3d_VDM_Isolated to avoid unpredictable behavior.
-  myVertexDrawMode = (theMode == Prs3d_VDM_Inherited ? Prs3d_VDM_Isolated : theMode);
+  myPointAspect = theAspect;
+  myHasOwnPointAspect = !myPointAspect.IsNull();
 }
 
-Prs3d_VertexDrawMode Prs3d_Drawer::VertexDrawMode () const
+// =======================================================================
+// function : LineAspect
+// purpose  :
+// =======================================================================
+
+const Handle(Prs3d_LineAspect)& Prs3d_Drawer::LineAspect()
 {
-  return myVertexDrawMode;
+  if (!HasOwnLineAspect())
+  {
+    if (!myLink.IsNull())
+    {
+      return myLink->LineAspect();
+    }
+    if (myLineAspect.IsNull())
+    {
+      myLineAspect = new Prs3d_LineAspect (Quantity_NOC_YELLOW, Aspect_TOL_SOLID, 1.0);
+    }
+  }
+  return myLineAspect;
 }
 
-Standard_Boolean Prs3d_Drawer::DrawHiddenLine () const {return myDrawHiddenLine;}
-
-void Prs3d_Drawer::EnableDrawHiddenLine () {myDrawHiddenLine=Standard_True;}
-
-void Prs3d_Drawer::DisableDrawHiddenLine () {myDrawHiddenLine=Standard_False;}
-
-Handle (Prs3d_LineAspect) Prs3d_Drawer::HiddenLineAspect ()  {
- if (myHiddenLineAspect.IsNull())
-   myHiddenLineAspect = new Prs3d_LineAspect
-     (Quantity_NOC_YELLOW,Aspect_TOL_DASH,0.5);
-
-  return myHiddenLineAspect;
-}
+// =======================================================================
+// function : SetLineAspect
+// purpose  :
+// =======================================================================
 
-void Prs3d_Drawer::SetHiddenLineAspect ( const Handle(Prs3d_LineAspect)& anAspect) {
- myHiddenLineAspect = anAspect;
+void Prs3d_Drawer::SetLineAspect (const Handle(Prs3d_LineAspect)& theAspect)
+{
+  myLineAspect = theAspect;
+  myHasOwnLineAspect = !myLineAspect.IsNull();
 }
 
-Handle (Prs3d_LineAspect) Prs3d_Drawer::SeenLineAspect ()  {
-  if (mySeenLineAspect.IsNull())
-    mySeenLineAspect = new Prs3d_LineAspect
-      (Quantity_NOC_YELLOW,Aspect_TOL_SOLID,1.);
-
-  return mySeenLineAspect;
-}
+// =======================================================================
+// function : TextAspect
+// purpose  :
+// =======================================================================
 
-void Prs3d_Drawer::SetSeenLineAspect ( const Handle(Prs3d_LineAspect)& anAspect) {
- mySeenLineAspect = anAspect;
+const Handle(Prs3d_TextAspect)& Prs3d_Drawer::TextAspect()
+{
+  if (!HasOwnTextAspect())
+  {
+    if (!myLink.IsNull())
+    {
+      return myLink->TextAspect();
+    }
+    if (myTextAspect.IsNull())
+    {
+      myTextAspect = new Prs3d_TextAspect();
+    }
+  }
+  return myTextAspect;
 }
 
-Handle (Prs3d_LineAspect) Prs3d_Drawer::VectorAspect ()  {
-  if (myVectorAspect.IsNull())
-    myVectorAspect = new Prs3d_LineAspect
-      (Quantity_NOC_SKYBLUE,Aspect_TOL_SOLID,1.);
+// =======================================================================
+// function : SetTextAspect
+// purpose  :
+// =======================================================================
 
-  return myVectorAspect;
+void Prs3d_Drawer::SetTextAspect (const Handle(Prs3d_TextAspect)& theAspect)
+{
+  myTextAspect = theAspect;
+  myHasOwnTextAspect = !myTextAspect.IsNull();
 }
 
-void Prs3d_Drawer::SetVectorAspect ( const Handle(Prs3d_LineAspect)& anAspect) {
- myVectorAspect = anAspect;
+// =======================================================================
+// function : ShadingAspect
+// purpose  :
+// =======================================================================
+
+const Handle(Prs3d_ShadingAspect)& Prs3d_Drawer::ShadingAspect()
+{
+  if (!HasOwnShadingAspect())
+  {
+    if (!myLink.IsNull())
+    {
+      return myLink->ShadingAspect();
+    }
+    if (myShadingAspect.IsNull())
+    {
+      myShadingAspect = new Prs3d_ShadingAspect();
+    }
+  }
+  return myShadingAspect;
 }
 
-Handle (Prs3d_DatumAspect) Prs3d_Drawer::DatumAspect () {
-  if (myDatumAspect.IsNull())
-    myDatumAspect = new Prs3d_DatumAspect;
+// =======================================================================
+// function : SetShadingAspect
+// purpose  :
+// =======================================================================
 
-  return myDatumAspect;
+void Prs3d_Drawer::SetShadingAspect (const Handle(Prs3d_ShadingAspect)& theAspect)
+{
+  myShadingAspect = theAspect;
+  myHasOwnShadingAspect = !myShadingAspect.IsNull();
 }
 
-void Prs3d_Drawer::SetDatumAspect ( const Handle(Prs3d_DatumAspect)& anAspect) {
- myDatumAspect = anAspect;
+// =======================================================================
+// function : SetShadingAspectGlobal
+// purpose  :
+// =======================================================================
+
+void Prs3d_Drawer::SetShadingAspectGlobal (const Standard_Boolean theValue)
+{
+  myHasOwnShadingAspectGlobal = Standard_True;
+  myShadingAspectGlobal       = theValue;
 }
 
-Handle (Prs3d_PlaneAspect) Prs3d_Drawer::PlaneAspect () {
-  if (myPlaneAspect.IsNull())
-    myPlaneAspect = new Prs3d_PlaneAspect;
+// =======================================================================
+// function : PlaneAspect
+// purpose  :
+// =======================================================================
 
+const Handle(Prs3d_PlaneAspect)& Prs3d_Drawer::PlaneAspect()
+{
+  if (!HasOwnPlaneAspect())
+  {
+    if (!myLink.IsNull())
+    {
+      return myLink->PlaneAspect();
+    }
+    if (myPlaneAspect.IsNull())
+    {
+      myPlaneAspect = new Prs3d_PlaneAspect();
+    }
+  }
   return myPlaneAspect;
 }
 
-void Prs3d_Drawer::SetPlaneAspect ( const Handle(Prs3d_PlaneAspect)& anAspect) {
-  myPlaneAspect = anAspect;
+// =======================================================================
+// function : SetPlaneAspect
+// purpose  :
+// =======================================================================
+
+void Prs3d_Drawer::SetPlaneAspect (const Handle(Prs3d_PlaneAspect)& theAspect)
+{
+  myPlaneAspect = theAspect;
+  myHasOwnPlaneAspect = !myPlaneAspect.IsNull();
 }
 
 // =======================================================================
-// function : DimensionAspect
+// function : SeenLineAspect
 // purpose  :
 // =======================================================================
-Handle(Prs3d_DimensionAspect) Prs3d_Drawer::DimensionAspect()
+
+const Handle(Prs3d_LineAspect)& Prs3d_Drawer::SeenLineAspect()
 {
-  if (myDimensionAspect.IsNull())
+  if (!HasOwnSeenLineAspect())
   {
-    myDimensionAspect = new Prs3d_DimensionAspect;
+    if (!myLink.IsNull())
+    {
+      return myLink->SeenLineAspect();
+    }
+    if (mySeenLineAspect.IsNull())
+    {
+      mySeenLineAspect = new Prs3d_LineAspect (Quantity_NOC_YELLOW, Aspect_TOL_SOLID, 1.0);
+    }
   }
-
-  return myDimensionAspect;
+  return mySeenLineAspect;
 }
 
 // =======================================================================
-// function : SetDimensionAspect
+// function : SetSeenLineAspect
 // purpose  :
 // =======================================================================
-void Prs3d_Drawer::SetDimensionAspect (const Handle(Prs3d_DimensionAspect)& theAspect)
+
+void Prs3d_Drawer::SetSeenLineAspect (const Handle(Prs3d_LineAspect)& theAspect)
 {
-  myDimensionAspect = theAspect;
+  mySeenLineAspect = theAspect;
+  myHasOwnSeenLineAspect = !mySeenLineAspect.IsNull();
 }
 
 // =======================================================================
-// function : SetDimLengthModelUnits
+// function : ArrowAspect
 // purpose  :
 // =======================================================================
-void Prs3d_Drawer::SetDimLengthModelUnits (const TCollection_AsciiString& theUnits)
+
+const Handle(Prs3d_ArrowAspect)& Prs3d_Drawer::ArrowAspect()
 {
-  myDimensionModelUnits.SetLengthUnits (theUnits);
+  if (!HasOwnArrowAspect())
+  {
+    if (!myLink.IsNull())
+    {
+      return myLink->ArrowAspect();
+    }
+    if (myArrowAspect.IsNull())
+    {
+      myArrowAspect = new Prs3d_ArrowAspect();
+    }
+  }
+  return myArrowAspect;
 }
 
 // =======================================================================
-// function : SetDimAngleModelUnits
+// function : SetArrowAspect
 // purpose  :
 // =======================================================================
-void Prs3d_Drawer::SetDimAngleModelUnits (const TCollection_AsciiString& theUnits)
+
+void Prs3d_Drawer::SetArrowAspect (const Handle(Prs3d_ArrowAspect)& theAspect)
 {
-  myDimensionModelUnits.SetAngleUnits (theUnits);
+  myArrowAspect = theAspect;
+  myHasOwnArrowAspect = !myArrowAspect.IsNull();
 }
 
 // =======================================================================
-// function : DimLengthModelUnits
+// function : SetLineArrowDraw
 // purpose  :
 // =======================================================================
-const TCollection_AsciiString& Prs3d_Drawer::DimLengthModelUnits() const
+
+void Prs3d_Drawer::SetLineArrowDraw (const Standard_Boolean theIsEnabled)
 {
-  return myDimensionModelUnits.GetLengthUnits();
+  myHasOwnLineArrowDraw = Standard_True;
+  myLineArrowDraw       = theIsEnabled;
 }
 
 // =======================================================================
-// function : DimAngleModelUnits
+// function : HiddenLineAspect
 // purpose  :
 // =======================================================================
-const TCollection_AsciiString& Prs3d_Drawer::DimAngleModelUnits() const
+
+const Handle(Prs3d_LineAspect)& Prs3d_Drawer::HiddenLineAspect()
 {
-  return myDimensionModelUnits.GetAngleUnits();
+  if (!HasOwnHiddenLineAspect())
+  {
+    if (!myLink.IsNull())
+    {
+      return myLink->HiddenLineAspect();
+    }
+    if (myHiddenLineAspect.IsNull())
+    {
+      myHiddenLineAspect = new Prs3d_LineAspect (Quantity_NOC_YELLOW, Aspect_TOL_DASH, 0.5);
+    }
+  }
+  return myHiddenLineAspect;
 }
 
 // =======================================================================
-// function : SetDimLengthDisplayUnits
+// function : SetHiddenLineAspect
 // purpose  :
 // =======================================================================
-void Prs3d_Drawer::SetDimLengthDisplayUnits (const TCollection_AsciiString& theUnits)
+
+void Prs3d_Drawer::SetHiddenLineAspect (const Handle(Prs3d_LineAspect)& theAspect)
 {
-  myDimensionDisplayUnits.SetLengthUnits (theUnits);
+  myHiddenLineAspect = theAspect;
+  myHasOwnHiddenLineAspect = !myHiddenLineAspect.IsNull();
 }
 
 // =======================================================================
-// function : SetDimAngleDisplayUnits
+// function : EnableDrawHiddenLineDraw
 // purpose  :
 // =======================================================================
-void Prs3d_Drawer::SetDimAngleDisplayUnits (const TCollection_AsciiString& theUnits)
+
+void Prs3d_Drawer::EnableDrawHiddenLine()
 {
-  myDimensionDisplayUnits.SetAngleUnits (theUnits);
+    myHasOwnDrawHiddenLine = Standard_True;
+    myDrawHiddenLine       = Standard_True;
 }
 
 // =======================================================================
-// function : DimLengthDisplayUnits
+// function : DisableDrawHiddenLine
 // purpose  :
 // =======================================================================
-const TCollection_AsciiString& Prs3d_Drawer::DimLengthDisplayUnits() const
+
+void Prs3d_Drawer::DisableDrawHiddenLine()
 {
-  return myDimensionDisplayUnits.GetLengthUnits();
+    myHasOwnDrawHiddenLine = Standard_True;
+    myDrawHiddenLine       = Standard_False;
 }
 
 // =======================================================================
-// function : DimAngleDisplayUnits
+// function : VectorAspect
 // purpose  :
 // =======================================================================
-const TCollection_AsciiString& Prs3d_Drawer::DimAngleDisplayUnits() const
+
+const Handle(Prs3d_LineAspect)& Prs3d_Drawer::VectorAspect()
 {
-  return myDimensionDisplayUnits.GetAngleUnits();
+  if (!HasOwnVectorAspect())
+  {
+    if (!myLink.IsNull())
+    {
+      return myLink->VectorAspect();
+    }
+    if (myVectorAspect.IsNull())
+    {
+      myVectorAspect = new Prs3d_LineAspect (Quantity_NOC_SKYBLUE, Aspect_TOL_SOLID, 1.0);
+    }
+  }
+  return myVectorAspect;
 }
 
 // =======================================================================
-// function : SectionAspect
+// function : SetVectorAspect
 // purpose  :
 // =======================================================================
-Handle (Prs3d_LineAspect) Prs3d_Drawer::SectionAspect()
-{
-  if (mySectionAspect.IsNull())
-  {
-    mySectionAspect = new Prs3d_LineAspect (Quantity_NOC_ORANGE, Aspect_TOL_SOLID, 1.0);
-  }
 
-  return mySectionAspect;
+void Prs3d_Drawer::SetVectorAspect (const Handle(Prs3d_LineAspect)& theAspect)
+{
+  myVectorAspect = theAspect;
+  myHasOwnVectorAspect = !myVectorAspect.IsNull();
 }
 
 // =======================================================================
-// function : SetSectionAspect
+// function : SetVertexDrawMode
 // purpose  :
 // =======================================================================
-void Prs3d_Drawer::SetSectionAspect (const Handle(Prs3d_LineAspect)& theAspect)
+
+void Prs3d_Drawer::SetVertexDrawMode (const Prs3d_VertexDrawMode theMode)
 {
-  mySectionAspect = theAspect;
+  // Prs3d_VDM_Inherited is default value and means
+  // that correct value should be taken from the Link if it exists.
+  myVertexDrawMode = theMode;
 }
 
 // =======================================================================
-// function : SetFaceBoundaryDraw
+// function : VertexDrawMode
 // purpose  :
 // =======================================================================
-void Prs3d_Drawer::SetFaceBoundaryDraw (const Standard_Boolean theIsEnabled)
+
+Prs3d_VertexDrawMode Prs3d_Drawer::VertexDrawMode()
 {
-  myFaceBoundaryDraw = theIsEnabled;
+  if (!HasOwnVertexDrawMode())
+  {
+      if (!myLink.IsNull())
+      {
+          return myLink->VertexDrawMode();
+      }
+      // Prs3d_VDM_Isolated is default value for this setting.
+      myVertexDrawMode = Prs3d_VDM_Isolated;
+  }
+  return myVertexDrawMode;
 }
 
 // =======================================================================
-// function : IsFaceBoundaryDraw
+// function : DatumAspect
 // purpose  :
 // =======================================================================
-Standard_Boolean Prs3d_Drawer::IsFaceBoundaryDraw () const
+
+const Handle(Prs3d_DatumAspect)& Prs3d_Drawer::DatumAspect()
 {
-  return myFaceBoundaryDraw;
+  if (!HasOwnDatumAspect())
+  {
+    if (!myLink.IsNull())
+    {
+      return myLink->DatumAspect();
+    }
+    if (myDatumAspect.IsNull())
+    {
+      myDatumAspect = new Prs3d_DatumAspect();
+    }
+  }
+  return myDatumAspect;
 }
 
 // =======================================================================
-// function : SetFaceBoundaryAspect
+// function : SetDatumAspect
 // purpose  :
 // =======================================================================
-void Prs3d_Drawer::SetFaceBoundaryAspect (const Handle(Prs3d_LineAspect)& theAspect)
+
+void Prs3d_Drawer::SetDatumAspect (const Handle(Prs3d_DatumAspect)& theAspect)
 {
-  myFaceBoundaryAspect = theAspect;
+  myDatumAspect = theAspect;
+  myHasOwnDatumAspect = !myDatumAspect.IsNull();
 }
 
 // =======================================================================
-// function : FaceBoundaryAspect
+// function : SectionAspect
 // purpose  :
 // =======================================================================
-Handle(Prs3d_LineAspect) Prs3d_Drawer::FaceBoundaryAspect ()
+
+const Handle(Prs3d_LineAspect)& Prs3d_Drawer::SectionAspect()
 {
-  if (myFaceBoundaryAspect.IsNull ())
+  if (!HasOwnSectionAspect())
   {
-    myFaceBoundaryAspect = 
-      new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0);
+    if (!myLink.IsNull())
+    {
+      return myLink->SectionAspect();
+    }
+    if (mySectionAspect.IsNull())
+    {
+      mySectionAspect = new Prs3d_LineAspect (Quantity_NOC_ORANGE, Aspect_TOL_SOLID, 1.0);
+    }
   }
-
-  return myFaceBoundaryAspect;
+  return mySectionAspect;
 }
 
 // =======================================================================
-// function : SetTypeOfHLR
-// purpose  : set type of HLR algorithm
+// function : SetSectionAspect
+// purpose  :
 // =======================================================================
-void Prs3d_Drawer::SetTypeOfHLR ( const Prs3d_TypeOfHLR theTypeOfHLR) 
+
+void Prs3d_Drawer::SetSectionAspect (const Handle(Prs3d_LineAspect)& theAspect)
 {
-  myTypeOfHLR = theTypeOfHLR;
+  mySectionAspect = theAspect;
+  myHasOwnSectionAspect = !mySectionAspect.IsNull();
 }
 
 // =======================================================================
-// function : TypeOfHLR
-// purpose  : gets type of HLR algorithm
+// function : SetSectionAspect
+// purpose  :
 // =======================================================================
-Prs3d_TypeOfHLR Prs3d_Drawer::TypeOfHLR ( ) const
+
+void Prs3d_Drawer::ClearLocalAttributes()
 {
-  return myTypeOfHLR;
+  if (myLink.IsNull())
+  {
+    return;
+  }
+
+  myUIsoAspect.Nullify();
+  myVIsoAspect.Nullify();
+  myFreeBoundaryAspect.Nullify();
+  myUnFreeBoundaryAspect.Nullify();
+  myFaceBoundaryAspect.Nullify();
+  myWireAspect.Nullify();
+  myLineAspect.Nullify();
+  myTextAspect.Nullify();
+  myShadingAspect.Nullify();
+  myPointAspect.Nullify();
+  myPlaneAspect.Nullify();
+  myArrowAspect.Nullify();
+  myHiddenLineAspect.Nullify();
+  mySeenLineAspect.Nullify();
+  myVectorAspect .Nullify();
+  myDatumAspect.Nullify();
+  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;
+
+  myHasOwnNbPoints                = Standard_False;
+  myHasOwnMaximalParameterValue   = Standard_False;
+  myHasOwnTypeOfDeflection        = Standard_False;
+  myHasOwnChordialDeviation       = Standard_False;
+  myHasOwnDeviationCoefficient    = Standard_False;
+  myHasOwnHLRDeviationCoefficient = Standard_False;
+  myHasOwnDeviationAngle          = Standard_False;
+  myHasOwnHLRDeviationAngle       = Standard_False;
+  myHasOwnIsoOnPlane              = Standard_False;
+  myHasOwnWireDraw                = Standard_False;
+  myHasOwnShadingAspectGlobal     = Standard_False;
+  myHasOwnLineArrowDraw           = Standard_False;
+  myHasOwnDrawHiddenLine          = Standard_False;
+  myHasOwnFreeBoundaryDraw        = Standard_False;
+  myHasOwnUnFreeBoundaryDraw      = Standard_False;
+  myHasOwnFaceBoundaryDraw        = Standard_False;
+  myHasOwnDimLengthModelUnits     = Standard_False;
+  myHasOwnDimLengthDisplayUnits   = Standard_False;
+  myHasOwnDimAngleModelUnits      = Standard_False;
+  myHasOwnDimAngleDisplayUnits    = Standard_False;
+
+  myVertexDrawMode = Prs3d_VDM_Inherited;
+  myTypeOfHLR      = Prs3d_TOH_NotSet;
 }
diff --git a/src/Prs3d/Prs3d_Drawer.hxx b/src/Prs3d/Prs3d_Drawer.hxx
new file mode 100644 (file)
index 0000000..58232df
--- /dev/null
@@ -0,0 +1,910 @@
+// Copyright (c) 1995-1999 Matra Datavision
+// Copyright (c) 1999-2014 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#ifndef _Prs3d_Drawer_HeaderFile
+#define _Prs3d_Drawer_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+
+#include <Handle_Prs3d_IsoAspect.hxx>
+#include <Standard_Integer.hxx>
+#include <Standard_Boolean.hxx>
+#include <Handle_Prs3d_LineAspect.hxx>
+#include <Handle_Prs3d_TextAspect.hxx>
+#include <Handle_Prs3d_ShadingAspect.hxx>
+#include <Quantity_Length.hxx>
+#include <Aspect_TypeOfDeflection.hxx>
+#include <Standard_Real.hxx>
+#include <Handle_Prs3d_PointAspect.hxx>
+#include <Prs3d_VertexDrawMode.hxx>
+#include <Handle_Prs3d_PlaneAspect.hxx>
+#include <Handle_Prs3d_ArrowAspect.hxx>
+#include <Handle_Prs3d_DatumAspect.hxx>
+#include <Handle_Prs3d_DimensionAspect.hxx>
+#include <Prs3d_DimensionUnits.hxx>
+#include <Prs3d_TypeOfHLR.hxx>
+#include <MMgt_TShared.hxx>
+
+class Prs3d_IsoAspect;
+class Prs3d_LineAspect;
+class Prs3d_TextAspect;
+class Prs3d_ShadingAspect;
+class Prs3d_PointAspect;
+class Prs3d_PlaneAspect;
+class Prs3d_ArrowAspect;
+class Prs3d_DatumAspect;
+class Prs3d_DimensionAspect;
+class TCollection_AsciiString;
+
+DEFINE_STANDARD_HANDLE(Prs3d_Drawer, MMgt_TShared)
+
+//! A graphic attribute manager which governs how
+//! objects such as color, width, line thickness and deflection are displayed.
+//! A drawer includes an instance of the Aspect classes with particular default values.
+class Prs3d_Drawer : public MMgt_TShared
+{
+
+public:
+
+  //! Default constructor.
+  Standard_EXPORT Prs3d_Drawer();
+
+  //! 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);
+
+  //! Returns the type of chordal deflection.
+  //! This indicates whether the deflection value is absolute or relative to the size of the object.
+  Aspect_TypeOfDeflection TypeOfDeflection() const
+  {
+    return HasOwnTypeOfDeflection() || myLink.IsNull()
+         ? myTypeOfDeflection
+         : myLink->TypeOfDeflection();
+  }
+
+  //! Returns true if the drawer has a type of deflection setting active.
+  Standard_Boolean HasOwnTypeOfDeflection() const { return myHasOwnTypeOfDeflection; }
+
+  //! Defines the maximal chordial deviation when drawing any curve.
+  //! Even if the type of deviation is set to TOD_Relative, this value is used by: 
+  //!   Prs3d_DeflectionCurve
+  //!   Prs3d_WFDeflectionSurface
+  //!   Prs3d_WFDeflectionRestrictedFace
+  Standard_EXPORT void SetMaximalChordialDeviation (const Quantity_Length theChordialDeviation);
+
+  //! Returns the maximal chordal deviation. The default value is 0.1.
+  //! Drawings of curves or patches are made with respect to an absolute maximal chordal deviation.
+  Quantity_Length MaximalChordialDeviation() const
+  {
+    return HasOwnMaximalChordialDeviation() || myLink.IsNull()
+         ? myChordialDeviation
+         : myLink->MaximalChordialDeviation();
+  }
+
+  //! Returns true if the drawer has a maximal chordial deviation setting active.
+  Standard_Boolean HasOwnMaximalChordialDeviation() const { return myHasOwnChordialDeviation; }
+
+  //! 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();
+
+  //! 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);
+
+  //! 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 HasOwnMaximalParameterValue() || myLink.IsNull()
+         ? myMaximalParameterValue
+         : myLink->MaximalParameterValue();
+  }
+
+  //! 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; }
+
+  //! Sets IsoOnPlane on or off by setting the parameter theIsEnabled to true or false.
+  Standard_EXPORT void SetIsoOnPlane (const Standard_Boolean theIsEnabled);
+
+  //! Returns True if the drawing of isos on planes is enabled.
+  Standard_Boolean IsoOnPlane() const
+  {
+    return HasOwnIsoOnPlane() || myLink.IsNull()
+         ? myIsoOnPlane
+         : myLink->IsoOnPlane();
+  }
+
+  //! Returns true if the drawer has IsoOnPlane setting active.
+  Standard_Boolean HasOwnIsoOnPlane() const { return myHasOwnIsoOnPlane; }
+
+  //! Sets the discretisation parameter theValue.
+  Standard_EXPORT void SetDiscretisation (const Standard_Integer theValue);
+
+  //! Returns the discretisation setting. 
+  Standard_Integer Discretisation() const
+  {
+    return HasOwnDiscretisation() || myLink.IsNull()
+         ? myNbPoints
+         : myLink->Discretisation();
+  }
+
+  //! Returns true if the drawer has discretisation setting active.
+  Standard_Boolean HasOwnDiscretisation() const { return myHasOwnNbPoints; }
+
+  //! Sets the deviation coefficient theCoefficient.
+  //! Also sets the hasOwnDeviationCoefficient flag to Standard_True and myPreviousDeviationCoefficient
+  Standard_EXPORT void SetDeviationCoefficient (const Standard_Real theCoefficient);
+
+  //! Returns the deviation coefficient.
+  //! Drawings of curves or patches are made with respect
+  //! to a maximal chordal deviation. A Deviation coefficient
+  //! is used in the shading display mode. The shape is
+  //! seen decomposed into triangles. These are used to
+  //! calculate reflection of light from the surface of the
+  //! object. The triangles are formed from chords of the
+  //! curves in the shape. The deviation coefficient gives
+  //! the highest value of the angle with which a chord can
+  //! deviate from a tangent to a   curve. If this limit is
+  //! reached, a new triangle is begun.
+  //! This deviation is absolute and is set through the
+  //! method: SetMaximalChordialDeviation. The default value is 0.001.
+  //! In drawing shapes, however, you are allowed to ask
+  //! for a relative deviation. This deviation will be:
+  //! SizeOfObject * DeviationCoefficient.
+  Standard_Real DeviationCoefficient() const
+  {
+    return HasOwnDeviationCoefficient() || myLink.IsNull()
+         ? myDeviationCoefficient
+         : myLink->DeviationCoefficient();
+  }
+
+  //! Sets the hasOwnDeviationCoefficient flag to Standard_False
+  void SetDeviationCoefficient()
+  {
+    myHasOwnDeviationCoefficient = Standard_False;
+  }
+
+  //! 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; }
+
+  //! Saves the previous value used for the chordal
+  //! deviation coefficient. 
+  Standard_Real PreviousDeviationCoefficient() const
+  {
+    return myHasOwnDeviationCoefficient
+         ? myPreviousDeviationCoefficient
+         : 0.0;
+  }
+
+  //! Sets the deviation coefficient aCoefficient for removal
+  //! of hidden lines created by different viewpoints in
+  //! different presentations. The Default value is 0.02.
+  //! Also sets the hasOwnHLRDeviationCoefficient flag to Standard_True and myPreviousHLRDeviationCoefficient
+  Standard_EXPORT void SetHLRDeviationCoefficient (const Standard_Real theCoefficient);
+
+  //! Returns the real number value of the hidden line
+  //! removal deviation coefficient in this framework, if the flag
+  //! hasOwnHLRDeviationCoefficient is true or there is no Link.
+  //! Else the shape's HLR deviation coefficient is used.
+  //! A Deviation coefficient is used in the shading display
+  //! mode. The shape is seen decomposed into triangles.
+  //! These are used to calculate reflection of light from the
+  //! surface of the object.
+  //! The triangles are formed from chords of the curves in
+  //! the shape. The deviation coefficient give the highest
+  //! value of the angle with which a chord can deviate
+  //! from a tangent to a curve. If this limit is reached, a new triangle is begun.
+  //! To find the hidden lines, hidden line display mode
+  //! entails recalculation of the view at each different projector perspective.
+  //! Since hidden lines entail calculations of more than
+  //! usual complexity to decompose them into these
+  //! triangles, a deviation coefficient allowing greater
+  //! tolerance is used. This increases efficiency in calculation.
+  //! The Default value is 0.02.
+  Standard_Real HLRDeviationCoefficient() const
+  {
+    return HasOwnHLRDeviationCoefficient() || myLink.IsNull()
+         ? myHLRDeviationCoefficient
+         : myLink->HLRDeviationCoefficient();
+  }
+
+  //! Sets the hasOwnHLRDeviationCoefficient flag to Standard_False 
+  void SetHLRDeviationCoefficient()
+  {
+    myHasOwnHLRDeviationCoefficient = Standard_False;
+  }
+
+  //! Returns true if the there is a setting for HLR deviation
+  //! coefficient in this framework for a specific interactive object.
+  Standard_Boolean HasOwnHLRDeviationCoefficient() const { return myHasOwnHLRDeviationCoefficient; }
+
+  //! Returns the previous value of the hidden line removal deviation coefficient.
+  Standard_Real PreviousHLRDeviationCoefficient() const
+  {
+    return myHasOwnHLRDeviationCoefficient
+         ? myPreviousHLRDeviationCoefficient
+         : 0.0;
+  }
+
+  //! Sets the deviation angle theAngle.
+  //! Also sets the hasOwnDeviationAngle flag to Standard_True, and myPreviousDeviationAngle.
+  Standard_EXPORT void SetDeviationAngle (const Standard_Real theAngle);
+
+  //! Returns the value for deviation angle.
+  Standard_Real DeviationAngle() const
+  {
+    return HasOwnDeviationAngle() || myLink.IsNull()
+         ? myDeviationAngle
+         : myLink->DeviationAngle();
+  }
+
+  //! Sets the hasOwnDeviationAngle flag to Standard_False
+  void SetDeviationAngle()
+  {
+    myHasOwnDeviationAngle = Standard_False;
+  }
+
+  //! Returns true if the there is a local setting for deviation
+  //! angle in this framework for a specific interactive object.
+  Standard_Boolean HasOwnDeviationAngle() const { return myHasOwnDeviationAngle; }
+
+  //! Returns the previous deviation angle
+  Standard_Real PreviousDeviationAngle() const
+  {
+    return myHasOwnDeviationAngle
+         ? myPreviousDeviationAngle
+         : 0.0;
+  }
+
+  //! Sets anAngle, the angle of maximum chordal deviation for removal of hidden lines created by
+  //! different viewpoints in different presentations.
+  //! The default value is 20 * M_PI / 180.
+  //! Also sets the hasOwnHLRDeviationAngle flag to Standard_True and myPreviousHLRDeviationAngle.
+  Standard_EXPORT void SetHLRAngle (const Standard_Real theAngle);
+
+  //! Returns the real number value of the deviation angle
+  //! in hidden line removal views. The default value is 20 * M_PI / 180.
+  Standard_Real HLRAngle() const
+  {
+    return HasOwnHLRDeviationAngle() || myLink.IsNull()
+         ? myHLRAngle
+         : myLink->HLRAngle();
+  }
+
+  //! Sets the hasOwnHLRDeviationAngle flag to Standard_False
+  void SetHLRAngle()
+  {
+    myHasOwnHLRDeviationAngle = Standard_False;
+  }
+
+  //! Returns true if the there is a setting for HLR deviation
+  //! angle in this framework for a specific interactive object.
+  Standard_Boolean HasOwnHLRDeviationAngle() const { return myHasOwnHLRDeviationAngle; }
+
+  //! Returns the previous value of the HLR deviation angle.
+  Standard_Real PreviousHLRDeviationAngle() const
+  {
+    return myHasOwnHLRDeviationAngle
+         ? myPreviousHLRDeviationAngle
+         : 0.0;
+  }
+
+  //! 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
+  //!
+  //! These attributes are used by the following algorithms:
+  //!   Prs3d_WFDeflectionSurface
+  //!   Prs3d_WFDeflectionRestrictedFace
+  Standard_EXPORT const Handle(Prs3d_IsoAspect)& UIsoAspect();
+
+  Standard_EXPORT void SetUIsoAspect (const Handle(Prs3d_IsoAspect)& 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
+  //!
+  //! These attributes are used by the following algorithms:
+  //!   Prs3d_WFDeflectionSurface
+  //!   Prs3d_WFDeflectionRestrictedFace
+  Standard_EXPORT const Handle(Prs3d_IsoAspect)& VIsoAspect();
+
+  //! Sets the appearance of V isoparameters - theAspect.
+  Standard_EXPORT void SetVIsoAspect (const Handle(Prs3d_IsoAspect)& 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
+  //! These attributes are used by the algorithm Prs3d_WFShape.
+  Standard_EXPORT const Handle(Prs3d_LineAspect)& WireAspect();
+
+  //! Sets the parameter theAspect for display of wires.
+  Standard_EXPORT void SetWireAspect (const Handle(Prs3d_LineAspect)& 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; }
+
+  //! Sets WireDraw on or off by setting the parameter theIsEnabled to true or false.
+  Standard_EXPORT void SetWireDraw(const Standard_Boolean theIsEnabled);
+
+  //! Returns True if the drawing of the wire is enabled.
+  Standard_Boolean WireDraw() const
+  {
+    return HasOwnWireDraw() || myLink.IsNull()
+         ? myWireDraw
+         : myLink->WireDraw();
+  }
+
+  //! Returns true if the drawer has its own attribute for
+  //! "draw wires" flag that overrides the one in the link.
+  Standard_Boolean HasOwnWireDraw() const { return myHasOwnWireDraw; }
+
+  //! Returns the point aspect setting. The default values are
+  //!   Color: Quantity_NOC_YELLOW
+  //!   Type of marker: Aspect_TOM_PLUS
+  //!   Scale: 1.0
+  //! These attributes are used by the algorithms Prs3d_Point.
+  Standard_EXPORT const Handle(Prs3d_PointAspect)& PointAspect();
+
+  //! Sets the parameter theAspect for display attributes of points
+  Standard_EXPORT void SetPointAspect (const Handle(Prs3d_PointAspect)& 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; }
+
+  //! 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
+  //! These attributes are used by the following algorithms:
+  //!   Prs3d_Curve
+  //!   Prs3d_Line
+  //!   Prs3d_HLRShape
+  Standard_EXPORT const Handle(Prs3d_LineAspect)& LineAspect();
+
+  //! Sets the parameter theAspect for display attributes of lines.
+  Standard_EXPORT void SetLineAspect (const Handle(Prs3d_LineAspect)& 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; }
+
+  //! 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();
+
+  //! Sets the parameter theAspect for display attributes of text.
+  Standard_EXPORT void SetTextAspect (const Handle(Prs3d_TextAspect)& 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_NOM_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.
+  Standard_EXPORT  void SetShadingAspect (const Handle(Prs3d_ShadingAspect)& 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; }
+
+  //! Returns True if the ShadingAspect is applied
+  //! to the whole presentation.
+  Standard_Boolean ShadingAspectGlobal() const
+  {
+    return HasOwnShadingAspectGlobal() || myLink.IsNull()
+         ? myShadingAspectGlobal
+         : myLink->ShadingAspectGlobal();
+  }
+
+  //! Indicates that the ShadingAspect will be apply
+  //! to the whole presentation. This allows to modify
+  //! the aspect without recomputing the content of the presentation.
+  Standard_EXPORT void SetShadingAspectGlobal (const Standard_Boolean theValue);
+
+  //! Returns true if the drawer has its own attribute for
+  //! ShadingAspectGlobal flag that overrides the one in the link.
+  Standard_Boolean HasOwnShadingAspectGlobal() const { return myHasOwnShadingAspectGlobal; }
+
+  //! 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();
+
+  //! Sets the parameter theAspect for the display of seen lines in hidden line removal mode.
+  Standard_EXPORT void SetSeenLineAspect (const Handle(Prs3d_LineAspect)& 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; }
+
+  //! Returns settings for the appearance of planes.
+  Standard_EXPORT const Handle(Prs3d_PlaneAspect)& PlaneAspect();
+
+  //! Sets the parameter theAspect for the display of planes. 
+  Standard_EXPORT void SetPlaneAspect (const Handle(Prs3d_PlaneAspect)& 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; }
+
+  //! Returns the attributes for display of arrows.
+  Standard_EXPORT const Handle(Prs3d_ArrowAspect)& ArrowAspect();
+
+  //! Sets the parameter theAspect for display attributes of arrows.
+  Standard_EXPORT void SetArrowAspect (const Handle(Prs3d_ArrowAspect)& 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; }
+
+  //! Enables the drawing of an arrow at the end of each line.
+  //! By default the arrows are not drawn.
+  Standard_EXPORT void SetLineArrowDraw (const Standard_Boolean theIsEnabled);
+
+  //! Returns True if drawing an arrow at the end of each edge is enabled
+  //! and False otherwise (the default).
+  Standard_Boolean LineArrowDraw() const
+  {
+    return HasOwnLineArrowDraw() || myLink.IsNull()
+         ? myLineArrowDraw
+         : myLink->LineArrowDraw();
+  }
+
+  //! Returns true if the drawer has its own attribute for
+  //! "draw arrow" flag that overrides the one in the link.
+  Standard_Boolean HasOwnLineArrowDraw() const
+  {
+    return myHasOwnLineArrowDraw;
+  }
+
+  //! 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();
+
+  //! Sets the parameter theAspect for the display of hidden lines in hidden line removal mode.
+  Standard_EXPORT void SetHiddenLineAspect (const Handle(Prs3d_LineAspect)& 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; }
+
+  //! Returns Standard_True if the hidden lines are to be drawn.
+  //! By default the hidden lines are not drawn.
+  Standard_Boolean DrawHiddenLine() const
+  {
+    return HasOwnDrawHiddenLine() || myLink.IsNull()
+         ? myDrawHiddenLine
+         : myLink->DrawHiddenLine();
+  }
+
+  //! Enables the DrawHiddenLine function.
+  Standard_EXPORT void EnableDrawHiddenLine();
+
+  //! Disables the DrawHiddenLine function.
+  Standard_EXPORT void DisableDrawHiddenLine();
+
+  //! Returns true if the drawer has its own attribute for
+  //! "draw hidden lines" flag that overrides the one in the link.
+  Standard_Boolean HasOwnDrawHiddenLine() const { return myHasOwnDrawHiddenLine; }
+
+  //! 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();
+
+  //! Sets the modality theAspect for the display of vectors.
+  Standard_EXPORT void SetVectorAspect (const Handle(Prs3d_LineAspect)& 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; }
+
+  //! 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,
+  //! that corresponds to Prs3d_VDM_Standalone mode. 
+  //! Switching to Prs3d_VDM_Standalone mode makes all shape's vertices visible.
+  //! To inherit this parameter from the global drawer instance ("the link") when it is present,
+  //! Prs3d_VDM_Inherited value should be used.
+  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();
+
+  //! 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();
+
+  //! Sets the modality theAspect for the display of datums.
+  Standard_EXPORT void SetDatumAspect (const Handle(Prs3d_DatumAspect)& 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; }
+
+  //! 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
+  //! These attributes are used by the algorithm Prs3d_WFShape.
+  Standard_EXPORT const Handle(Prs3d_LineAspect)& SectionAspect();
+
+  //! Sets the parameter theAspect for display attributes of sections. 
+  Standard_EXPORT void SetSectionAspect (const Handle(Prs3d_LineAspect)& 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; }
+
+  //! 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
+  //! These attributes are used by the algorithm Prs3d_WFShape
+  Standard_EXPORT const Handle(Prs3d_LineAspect)& FreeBoundaryAspect();
+
+  //! 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; }
+
+  //! Enables or disables drawing of free boundaries for shading presentations.
+  //! The method sets drawing flag owned by the drawer that will be used during
+  //! visualization instead of the one set in link.
+  //! theIsEnabled is a boolean flag indicating whether the free boundaries should be
+  //! drawn or not.
+  Standard_EXPORT void SetFreeBoundaryDraw (const Standard_Boolean theIsEnabled);
+
+  //! Returns True if the drawing of the free boundaries is enabled
+  //! True is the default setting.
+  Standard_Boolean FreeBoundaryDraw() const
+  {
+    return HasOwnFreeBoundaryDraw() || myLink.IsNull()
+         ? myFreeBoundaryDraw
+         : myLink->FreeBoundaryDraw();
+  }
+
+  //! Returns true if the drawer has its own attribute for
+  //! "draw free boundaries" flag that overrides the one in the link.
+  Standard_Boolean HasOwnFreeBoundaryDraw() const { return myHasOwnFreeBoundaryDraw; }
+
+  //! 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.
+  //! These attributes are used by the algorithm Prs3d_WFShape
+  Standard_EXPORT const Handle(Prs3d_LineAspect)& UnFreeBoundaryAspect();
+
+  //! 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; }
+
+  //! Enables or disables drawing of shared boundaries for shading presentations.
+  //! The method sets drawing flag owned by the drawer that will be used during
+  //! visualization instead of the one set in link.
+  //! theIsEnabled is a boolean flag indicating whether the shared boundaries should be drawn or not.
+  Standard_EXPORT void SetUnFreeBoundaryDraw (const Standard_Boolean theIsEnabled);
+
+  //! Returns True if the drawing of the shared boundaries is enabled.
+  //! True is the default setting.
+  Standard_Boolean UnFreeBoundaryDraw() const
+  {
+    return HasOwnUnFreeBoundaryDraw() || myLink.IsNull()
+         ? myUnFreeBoundaryDraw
+         : myLink->UnFreeBoundaryDraw();
+  }
+
+  //! Returns true if the drawer has its own attribute for
+  //! "draw shared boundaries" flag that overrides the one in the link.
+  Standard_Boolean HasOwnUnFreeBoundaryDraw() const { return myHasOwnUnFreeBoundaryDraw; }
+
+  //! Sets line aspect for face boundaries.
+  //! 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);
+
+  //! Returns line aspect of face boundaries.
+  Standard_EXPORT const Handle(Prs3d_LineAspect)& FaceBoundaryAspect();
+
+  //! 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; }
+
+  //! Enables or disables face boundary drawing for shading presentations. 
+  //! The method sets drawing flag owned by the drawer that will be used during
+  //! visualization instead of the one set in link.
+  //! theIsEnabled is a boolean flag indicating whether the face boundaries should be drawn or not.
+  Standard_EXPORT void SetFaceBoundaryDraw (const Standard_Boolean theIsEnabled);
+
+  //! Checks whether the face boundary drawing is enabled or not.
+  Standard_Boolean FaceBoundaryDraw() const
+  {
+    return HasOwnFaceBoundaryDraw() || myLink.IsNull()
+         ? myFaceBoundaryDraw
+         : myLink->FaceBoundaryDraw();
+  }
+
+  //! Returns true if the drawer has its own attribute for
+  //! "draw face boundaries" flag that overrides the one in the link.
+  Standard_Boolean HasOwnFaceBoundaryDraw() const { return myHasOwnFaceBoundaryDraw; }
+
+  //! Returns settings for the appearance of dimensions. 
+  Standard_EXPORT const Handle(Prs3d_DimensionAspect)& DimensionAspect();
+
+  //! 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);
+
+  //! 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; }
+
+  //! Sets dimension length model units for computing of dimension presentation.
+  //! The method sets value owned by the drawer that will be used during
+  //! visualization instead of the one set in link.
+  Standard_EXPORT void SetDimLengthModelUnits (const TCollection_AsciiString& theUnits);
+
+  //! Sets dimension angle model units for computing of dimension presentation.
+  //! The method sets value owned by the drawer that will be used during
+  //! visualization instead of the one set in link.
+  Standard_EXPORT void SetDimAngleModelUnits (const TCollection_AsciiString& theUnits);
+
+  //! Returns length model units for the dimension presentation. 
+  const TCollection_AsciiString& DimLengthModelUnits() const
+  {
+    return HasOwnDimLengthModelUnits() || myLink.IsNull()
+         ? myDimensionModelUnits.GetLengthUnits()
+         : myLink->DimLengthModelUnits();
+  }
+
+  //! Returns angle model units for the dimension presentation. 
+  const TCollection_AsciiString& DimAngleModelUnits() const
+  {
+    return HasOwnDimAngleModelUnits() || myLink.IsNull()
+         ? myDimensionModelUnits.GetAngleUnits()
+         : myLink->DimAngleModelUnits();
+  }
+
+  //! Returns true if the drawer has its own attribute for
+  //! dimension length model units that overrides the one in the link.
+  Standard_Boolean HasOwnDimLengthModelUnits() const { return myHasOwnDimLengthModelUnits; }
+
+  //! Returns true if the drawer has its own attribute for
+  //! dimension angle model units that overrides the one in the link.
+  Standard_Boolean HasOwnDimAngleModelUnits() const { return myHasOwnDimAngleModelUnits; }
+
+  //! Sets length units in which value for dimension presentation is displayed.
+  //! The method sets value owned by the drawer that will be used during
+  //! visualization instead of the one set in link.
+  Standard_EXPORT void SetDimLengthDisplayUnits (const TCollection_AsciiString& theUnits);
+
+  //! Sets angle units in which value for dimension presentation is displayed.
+  //! The method sets value owned by the drawer that will be used during
+  //! visualization instead of the one set in link.
+  Standard_EXPORT void SetDimAngleDisplayUnits (const TCollection_AsciiString& theUnits);
+
+  //! Returns length units in which dimension presentation is displayed.
+  const TCollection_AsciiString& DimLengthDisplayUnits() const
+  {
+    return HasOwnDimLengthDisplayUnits() || myLink.IsNull()
+         ? myDimensionDisplayUnits.GetLengthUnits()
+         : myLink->DimLengthDisplayUnits();
+  }
+
+  //! Returns angle units in which dimension presentation is displayed.
+  const TCollection_AsciiString& DimAngleDisplayUnits() const
+  {
+    return HasOwnDimAngleDisplayUnits() || myLink.IsNull()
+         ? myDimensionDisplayUnits.GetAngleUnits()
+         : myLink->DimAngleDisplayUnits();
+  }
+
+  //! Returns true if the drawer has its own attribute for
+  //! length units in which dimension presentation is displayed
+  //! that overrides the one in the link.
+  Standard_Boolean HasOwnDimLengthDisplayUnits() const { return myHasOwnDimLengthDisplayUnits; }
+
+  //! Returns true if the drawer has its own attribute for
+  //! angle units in which dimension presentation is displayed
+  //! that overrides the one in the link.
+  Standard_Boolean HasOwnDimAngleDisplayUnits() const { return myHasOwnDimAngleDisplayUnits; }
+
+  //! Returns the drawer to which the current object references.
+  const Handle(Prs3d_Drawer)& Link() { return myLink; }
+
+  //! Returns true if the current object has a link on the other drawer.
+  Standard_Boolean HasLink() const { return !myLink.IsNull(); }
+
+  //! Sets theDrawer as a link to which the current object references.
+  void Link (const Handle(Prs3d_Drawer)& theDrawer)
+  {
+    myLink = theDrawer;
+  }
+
+  //! Removes local attributes. 
+  Standard_EXPORT void ClearLocalAttributes();
+
+protected:
+
+  Handle(Prs3d_Drawer)          myLink;
+
+  Standard_Integer              myNbPoints;
+  Standard_Boolean              myHasOwnNbPoints;
+  Standard_Real                 myMaximalParameterValue;
+  Standard_Boolean              myHasOwnMaximalParameterValue;
+  Quantity_Length               myChordialDeviation;
+  Standard_Boolean              myHasOwnChordialDeviation;
+  Aspect_TypeOfDeflection       myTypeOfDeflection;
+  Standard_Boolean              myHasOwnTypeOfDeflection;
+  Prs3d_TypeOfHLR               myTypeOfHLR;
+  Standard_Real                 myDeviationCoefficient;
+  Standard_Real                 myPreviousDeviationCoefficient;
+  Standard_Boolean              myHasOwnDeviationCoefficient;
+  Standard_Real                 myHLRDeviationCoefficient;
+  Standard_Boolean              myHasOwnHLRDeviationCoefficient;
+  Standard_Real                 myPreviousHLRDeviationCoefficient;
+  Standard_Real                 myDeviationAngle;
+  Standard_Boolean              myHasOwnDeviationAngle;
+  Standard_Real                 myPreviousDeviationAngle;
+  Standard_Real                 myHLRAngle;
+  Standard_Boolean              myHasOwnHLRDeviationAngle;
+  Standard_Real                 myPreviousHLRDeviationAngle;
+  Standard_Boolean              myIsoOnPlane;
+  Standard_Boolean              myHasOwnIsoOnPlane;
+
+  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;
+  Standard_Boolean              myShadingAspectGlobal;
+  Standard_Boolean              myHasOwnShadingAspectGlobal;
+  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_Boolean              myHasOwnFaceBoundaryAspect;
+  Standard_Boolean              myFaceBoundaryDraw;
+  Standard_Boolean              myHasOwnFaceBoundaryDraw;
+
+  Handle(Prs3d_DimensionAspect) myDimensionAspect;
+  Standard_Boolean              myHasOwnDimensionAspect;
+  Prs3d_DimensionUnits          myDimensionModelUnits;
+  Standard_Boolean              myHasOwnDimLengthModelUnits;
+  Standard_Boolean              myHasOwnDimAngleModelUnits;
+  Prs3d_DimensionUnits          myDimensionDisplayUnits;
+  Standard_Boolean              myHasOwnDimLengthDisplayUnits;
+  Standard_Boolean              myHasOwnDimAngleDisplayUnits;
+
+public:
+
+  DEFINE_STANDARD_RTTI(Prs3d_Drawer)
+
+};
+
+#endif // _Prs3d_Drawer_HeaderFile
index 58aeebd..c659bdf 100644 (file)
@@ -17,7 +17,7 @@
 class IsoAspect from Prs3d inherits LineAspect from Prs3d
        ---Purpose: A framework to define the display attributes of isoparameters.
        -- This framework can be used to modify the default
-       -- setting for isoparameters in AIS_Drawer.
+       -- setting for isoparameters in Prs3d_Drawer.
         
 uses 
 
index d0045cc..7a3ea38 100644 (file)
@@ -1311,8 +1311,8 @@ static Standard_Integer OCC1188 (Draw_Interpretor& di, Standard_Integer argc, co
   return 0;
 }
 
-#include <AIS_Drawer.hxx>
 #include <Graphic3d_MaterialAspect.hxx>
+#include <Prs3d_Drawer.hxx>
 #include <Prs3d_ShadingAspect.hxx>
 //=======================================================================
 //function : OCC1174_1
@@ -1326,44 +1326,47 @@ static Standard_Integer OCC1174_1 (Draw_Interpretor& di, Standard_Integer argc,
     return 1;
   }
 
-  Handle(AIS_InteractiveContext) AISContext = ViewerTest::GetAISContext();
-  if(AISContext.IsNull()) 
+  Handle(AIS_InteractiveContext) anAISContext = ViewerTest::GetAISContext();
+  if(anAISContext.IsNull())
   {
     di << "use 'vinit' command before " << argv[0] << "\n";
     return 1;
   }
 
-  TopoDS_Shape sh = DBRep::Get(argv[1]);
+  TopoDS_Shape aShape = DBRep::Get(argv[1]);
+
+  Handle(AIS_Shape) anAisIO = new AIS_Shape(aShape);
 
-  Handle(AIS_Shape) ais = new AIS_Shape(sh);
+  Quantity_Color aColF(0.0, 0.4, 0.0, Quantity_TOC_RGB);
+  Quantity_Color aColB(0.0, 0.0, 0.6, Quantity_TOC_RGB);
 
-  Quantity_Color colf(0.0, 0.4, 0.0, Quantity_TOC_RGB);
-  Quantity_Color colb(0.0, 0.0, 0.6, Quantity_TOC_RGB);
+  Handle(Prs3d_Drawer) aDrawer = anAisIO->Attributes();
+  Handle(Prs3d_ShadingAspect) aShadingAspect = aDrawer->ShadingAspect();
 
-  Handle(Prs3d_ShadingAspect) sa = ais->Attributes()->ShadingAspect();
+  Graphic3d_MaterialAspect aFront = aShadingAspect->Material(Aspect_TOFM_FRONT_SIDE);
+  aFront.SetAmbientColor(aColF);
+  aFront.SetDiffuseColor(aColF);
+  aFront.SetSpecularColor(aColF);
+  aFront.SetEmissiveColor(aColF);
+  aFront.SetTransparency(0.0);
+  aShadingAspect->SetMaterial(aFront,Aspect_TOFM_FRONT_SIDE);
 
-  Graphic3d_MaterialAspect front = sa->Material(Aspect_TOFM_FRONT_SIDE);
-  front.SetAmbientColor(colf);
-  front.SetDiffuseColor(colf);
-  front.SetSpecularColor(colf);
-  front.SetEmissiveColor(colf);
-  front.SetTransparency(0.0);
-  sa->SetMaterial(front,Aspect_TOFM_FRONT_SIDE);
+  Graphic3d_MaterialAspect aBack = aShadingAspect->Material(Aspect_TOFM_BACK_SIDE);
+  aBack.SetAmbientColor(aColB);
+  aBack.SetDiffuseColor(aColB);
+  aBack.SetSpecularColor(aColB);
+  aBack.SetEmissiveColor(aColB);
+  aBack.SetTransparency(0.0);
+  aShadingAspect->SetMaterial(aBack,Aspect_TOFM_BACK_SIDE);
 
-  Graphic3d_MaterialAspect back = sa->Material(Aspect_TOFM_BACK_SIDE);
-  back.SetAmbientColor(colb);
-  back.SetDiffuseColor(colb);
-  back.SetSpecularColor(colb);
-  back.SetEmissiveColor(colb);
-  back.SetTransparency(0.0);
-  sa->SetMaterial(back,Aspect_TOFM_BACK_SIDE);
+  aDrawer->SetShadingAspect (aShadingAspect);
 
-  AISContext->Display(ais,1,0);
+  anAISContext->Display(anAisIO, 1, 0);
 
   Standard_Real r, g, b; 
-  sa->Color(Aspect_TOFM_FRONT_SIDE).Values(r,g,b, Quantity_TOC_RGB);
+  aShadingAspect->Color(Aspect_TOFM_FRONT_SIDE).Values(r,g,b, Quantity_TOC_RGB);
   di << "Info: color on front side (" << r << "," << g << "," << b << ")\n";
-  sa->Color(Aspect_TOFM_BACK_SIDE).Values(r,g,b, Quantity_TOC_RGB);
+  aShadingAspect->Color(Aspect_TOFM_BACK_SIDE).Values(r,g,b, Quantity_TOC_RGB);
   di << "Info: color on back side (" << r << "," << g << "," << b << ")\n";
 
   return 0;
index 71a8099..770b52a 100644 (file)
@@ -25,7 +25,7 @@
 
 #include <BRepPrimAPI_MakeSphere.hxx>
 #include <Graphic3d_AspectFillArea3d.hxx>
-#include <AIS_Drawer.hxx>
+#include <Prs3d_Drawer.hxx>
 #include <Prs3d_ShadingAspect.hxx>
 
 //#include <AcisData_AcisModel.hxx>
@@ -47,7 +47,7 @@ static Standard_Integer BUC60738 (Draw_Interpretor& di, Standard_Integer /*argc*
   theAISShape->SetDisplayMode(1);
 
   //get the drawer
-  Handle(AIS_Drawer) theDrawer = theAISShape->Attributes();
+  Handle(Prs3d_Drawer) theDrawer = theAISShape->Attributes();
   Handle(Prs3d_ShadingAspect) theShadingAspect = theDrawer->ShadingAspect();
   Handle(Graphic3d_AspectFillArea3d) theAspectFillArea3d = theShadingAspect->Aspect();
 
index 5fca3dc..c1f5bf8 100644 (file)
@@ -17,7 +17,7 @@
 #include <QABugs_MyText.hxx>
 #include <Prs3d_Presentation.hxx>
 #include <Prs3d_TextAspect.hxx>
-#include <AIS_Drawer.hxx>
+#include <Prs3d_Drawer.hxx>
 #include <SelectMgr_EntityOwner.hxx>
 #include <Prs3d_Text.hxx>
 #include <Select3D_SensitiveBox.hxx>
index 6f2e305..f4f2083 100644 (file)
@@ -23,7 +23,7 @@
 #include <Graphic3d_ArrayOfTriangles.hxx>
 #include <gp_Dir.hxx>
 #include <gp_Pnt.hxx>
-#include <AIS_Drawer.hxx>
+#include <Prs3d_Drawer.hxx>
 
 QABugs_PresentableObject::QABugs_PresentableObject(const PrsMgr_TypeOfPresentation3d theTypeOfPresentation3d)
      :AIS_InteractiveObject(theTypeOfPresentation3d)
index 624e401..e011f98 100644 (file)
@@ -33,6 +33,7 @@ uses
     Selection             from SelectMgr,
     SequenceOfSelection   from SelectMgr,
     TypeOfPresentation3d  from PrsMgr,
+    Drawer                from Prs3d,
     Presentation          from Prs3d,
     PresentationManager   from PrsMgr,
     PresentationManager3d from PrsMgr,
@@ -186,9 +187,21 @@ is
    ---Purpose: Set Z layer ID and update all presentations of the selectable object.
    -- The layers mechanism allows drawing objects in higher layers in overlay of objects in lower layers.
 
+    SetAttributes(me:mutable; theDrawer: Drawer from Prs3d) is virtual;
+       ---Purpose: Initializes the drawing tool theDrawer.
+    
+    Attributes(me) returns any Drawer from Prs3d;
+       ---C++: return const&
+       ---C++:  inline
+       ---Purpose: Returns the attributes settings.
+        
+    UnsetAttributes(me:mutable) is virtual;
+       ---Purpose: Clears settings provided by the drawing tool theDrawer.
+
 fields
 
     myselections        : SequenceOfSelection is protected;
+    myDrawer            : Drawer from Prs3d is protected;
     mycurrent           : Integer;
     myAutoHilight       : Boolean from Standard;
 
index 070b52a..c65ba20 100644 (file)
@@ -23,6 +23,7 @@
 #include <SelectBasics_EntityOwner.hxx>
 #include <SelectMgr_EntityOwner.hxx>
 #include <PrsMgr_PresentationManager3d.hxx>
+#include <Prs3d_Drawer.hxx>
 
 #include <TopLoc_Location.hxx>
 #include <gp_Pnt.hxx>
@@ -43,10 +44,11 @@ static Standard_Integer Search (const SelectMgr_SequenceOfSelection& seq,
 // Purpose :
 //==================================================
 
-SelectMgr_SelectableObject::SelectMgr_SelectableObject( const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d):PrsMgr_PresentableObject(aTypeOfPresentation3d)
-{
-  myAutoHilight = Standard_True;
-}
+SelectMgr_SelectableObject::SelectMgr_SelectableObject( const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d):
+  PrsMgr_PresentableObject (aTypeOfPresentation3d),
+  myDrawer                 (new Prs3d_Drawer()),
+  myAutoHilight            (Standard_True)
+{}
 
 
 //==================================================
@@ -352,3 +354,27 @@ void SelectMgr_SelectableObject::SetZLayer (const Graphic3d_ZLayerId theLayerId)
     }
   }
 }
+
+//=======================================================================
+//function : SetAttributes
+//purpose  : 
+//=======================================================================
+void SelectMgr_SelectableObject::SetAttributes (const Handle(Prs3d_Drawer)& theDrawer)
+{
+  myDrawer = theDrawer;
+}
+
+//=======================================================================
+//function : UnsetAttributes
+//purpose  : 
+//=======================================================================
+void SelectMgr_SelectableObject::UnsetAttributes()
+{
+  Handle(Prs3d_Drawer) aDrawer = new Prs3d_Drawer();
+  if (myDrawer->HasLink())
+  {
+    aDrawer->Link (myDrawer->Link());
+  }
+  myDrawer = aDrawer;
+}
+
index 622fc47..f140d68 100644 (file)
@@ -25,4 +25,7 @@ inline const Handle(SelectMgr_Selection)& SelectMgr_SelectableObject::
 CurrentSelection() const
 {return myselections(mycurrent);}
 
+inline const Handle(Prs3d_Drawer)& SelectMgr_SelectableObject::
+Attributes() const
+{return myDrawer;}
 
index d6e8403..444d4d4 100644 (file)
@@ -544,7 +544,7 @@ void StdPrs_ShadedShape::Add (const Handle (Prs3d_Presentation)& thePrs,
                     (theVolume == StdPrs_Volume_Closed ? Standard_True : Standard_False));
   }
 
-  if (theDrawer->IsFaceBoundaryDraw())
+  if (theDrawer->FaceBoundaryDraw())
   {
     computeFaceBoundaries (theShape, thePrs, theDrawer);
   }
index f9cb3eb..af05292 100644 (file)
@@ -38,7 +38,8 @@ uses
     TDataXtd,
     Geom,
     TopoDS,
-    gp
+    gp,
+    Prs3d
     
     
 is
index 84b2402..3e474f3 100644 (file)
@@ -43,7 +43,7 @@ uses GUID                 from Standard,
      NameOfColor          from Quantity,
      PlaneAngle           from Quantity,
      NameOfMaterial       from Graphic3d,
-     Drawer               from AIS
+     Drawer               from Prs3d
 is
 
     GetID (myclass) returns GUID from Standard;
index 03fdd3b..4af5c69 100644 (file)
@@ -17,7 +17,6 @@
 #include <TDataXtd_Axis.hxx>
 #include <TDataXtd_Geometry.hxx>
 #include <AIS_Axis.hxx>
-#include <AIS_Drawer.hxx>
 #include <AIS_InteractiveContext.hxx>
 #include <Geom_Line.hxx>
 #include <gp_Lin.hxx>
index 1898ad0..0d86b88 100644 (file)
@@ -20,7 +20,6 @@
 #include <Standard_GUID.hxx>
 #include <TDataStd_Real.hxx>
 #include <TDataXtd_Position.hxx>
-#include <AIS_Drawer.hxx>
 #include <AIS_InteractiveContext.hxx>
 #include <AIS_Relation.hxx>
 
index 57cc9d3..b6e162b 100644 (file)
@@ -47,7 +47,6 @@
 #include <AIS_SymmetricRelation.hxx>
 #include <AIS_MidPointRelation.hxx>
 #include <AIS_InteractiveContext.hxx>
-#include <AIS_Drawer.hxx>
 #include <AIS_EqualRadiusRelation.hxx>
 #include <AIS_EqualDistanceRelation.hxx>
 #include <AIS_MinRadiusDimension.hxx> 
@@ -90,6 +89,7 @@
 #include <Standard_ErrorHandler.hxx>
 
 #include <TopTools_IndexedMapOfShape.hxx>
+#include <Prs3d_Drawer.hxx>
 
 static Standard_Boolean CheckShapesPair(const TopoDS_Shape& , const TopoDS_Shape& ); //ota
 
@@ -312,7 +312,7 @@ void TPrsStd_ConstraintTools::ComputeDistance (const Handle(TDataXtd_Constraint)
   Standard_Boolean isEdge      = Standard_False;
 
   Standard_Boolean SaveDrw = Standard_False;
-  Handle(AIS_Drawer) aDrawer;
+  Handle(Prs3d_Drawer) aDrawer;
   Handle(AIS_LengthDimension) aDim;
 
   if (!theAIS.IsNull())
@@ -1810,7 +1810,7 @@ void TPrsStd_ConstraintTools::ComputeOffset (const Handle(TDataXtd_Constraint)&
   Standard_Real val1;
   TCollection_ExtendedString txt;
   Handle(AIS_LengthDimension) ais;
-  //Handle(AIS_Drawer) aDrawer;
+  //Handle(Prs3d_Drawer) aDrawer;
 
   if (nbgeom == 1)
   {
index 369361f..99ee3e9 100644 (file)
@@ -27,7 +27,6 @@
 #include <AIS_Point.hxx>
 #include <AIS_Circle.hxx>
 #include <AIS_Shape.hxx>
-#include <AIS_Drawer.hxx>
 #include <AIS_InteractiveContext.hxx>
 #include <gp_Pnt.hxx>
 #include <gp_Lin.hxx>
index 6c30f3d..a7207bc 100644 (file)
@@ -18,7 +18,6 @@
 //#include <TDataStd_Datum.hxx>
 #include <TDataXtd_Geometry.hxx>
 #include <AIS_Plane.hxx>
-#include <AIS_Drawer.hxx>
 #include <AIS_InteractiveContext.hxx>
 #include <TNaming_NamedShape.hxx>
 #include <TNaming_Tool.hxx>
index 2b2115e..bd678bc 100644 (file)
@@ -18,7 +18,6 @@
 #include <TDataXtd_Geometry.hxx>
 //#include <TDataStd_Datum.hxx>
 #include <AIS_Point.hxx>
-#include <AIS_Drawer.hxx>
 #include <AIS_InteractiveContext.hxx>
 #include <Geom_Point.hxx>
 #include <Geom_CartesianPoint.hxx>
index 7790ba1..60505dc 100644 (file)
@@ -40,7 +40,6 @@
 #include <BRepAdaptor_Curve.hxx>
 #include <StdSelect_ShapeTypeFilter.hxx>
 #include <AIS.hxx>
-#include <AIS_Drawer.hxx>
 #include <AIS_ColoredShape.hxx>
 #include <AIS_InteractiveObject.hxx>
 #include <AIS_Trihedron.hxx>
 #include <Graphic3d_CStructure.hxx>
 #include <Graphic3d_TextureRoot.hxx>
 #include <Image_AlienPixMap.hxx>
+#include <Prs3d_Drawer.hxx>
 #include <Prs3d_ShadingAspect.hxx>
 #include <Prs3d_IsoAspect.hxx>
+#include <Prs3d_PointAspect.hxx>
 #include <Select3D_SensitiveWire.hxx>
 #include <SelectMgr_EntityOwner.hxx>
 #include <StdSelect_BRepOwner.hxx>
@@ -90,8 +91,9 @@ extern int ViewerMainLoop(Standard_Integer argc, const char** argv);
 
 #include <Graphic3d_NameOfMaterial.hxx>
 
-#define DEFAULT_COLOR    Quantity_NOC_GOLDENROD
-#define DEFAULT_MATERIAL Graphic3d_NOM_BRASS
+#define DEFAULT_COLOR              Quantity_NOC_GOLDENROD
+#define DEFAULT_FREEBOUNDARY_COLOR Quantity_NOC_GREEN
+#define DEFAULT_MATERIAL           Graphic3d_NOM_BRASS
 
 //=======================================================================
 //function : GetColorFromName
@@ -594,7 +596,7 @@ static int visos (Draw_Interpretor& di, Standard_Integer argc, const char** argv
       if (anObj->IsKind(STANDARD_TYPE(AIS_InteractiveObject))) {
         const Handle(AIS_InteractiveObject) aShape =
         Handle(AIS_InteractiveObject)::DownCast (anObj);
-        Handle(AIS_Drawer) CurDrawer = aShape->Attributes();
+        Handle(Prs3d_Drawer) CurDrawer = aShape->Attributes();
         Handle(Prs3d_IsoAspect) aUIso = CurDrawer->UIsoAspect();
         Handle(Prs3d_IsoAspect) aVIso = CurDrawer->VIsoAspect();
 
@@ -1395,6 +1397,12 @@ struct ViewerTest_AspectsChangeSet
 
   NCollection_Sequence<TopoDS_Shape> SubShapes;
 
+  Standard_Integer         ToSetShowFreeBoundary;
+  Standard_Integer         ToSetFreeBoundaryWidth;
+  Standard_Real            FreeBoundaryWidth;
+  Standard_Integer         ToSetFreeBoundaryColor;
+  Quantity_Color           FreeBoundaryColor;
+
   //! Empty constructor
   ViewerTest_AspectsChangeSet()
   : ToSetVisibility   (0),
@@ -1406,16 +1414,24 @@ struct ViewerTest_AspectsChangeSet
     ToSetTransparency (0),
     Transparency      (0.0),
     ToSetMaterial     (0),
-    Material (Graphic3d_NOM_DEFAULT) {}
+    Material          (Graphic3d_NOM_DEFAULT),
+    ToSetShowFreeBoundary  (0),
+    ToSetFreeBoundaryWidth (0),
+    FreeBoundaryWidth      (1.0),
+    ToSetFreeBoundaryColor (0),
+    FreeBoundaryColor      (DEFAULT_FREEBOUNDARY_COLOR) {}
 
   //! @return true if no changes have been requested
   Standard_Boolean IsEmpty() const
   {
-    return ToSetVisibility   == 0
-        && ToSetLineWidth    == 0
-        && ToSetTransparency == 0
-        && ToSetColor        == 0
-        && ToSetMaterial     == 0;
+    return ToSetVisibility        == 0
+        && ToSetLineWidth         == 0
+        && ToSetTransparency      == 0
+        && ToSetColor             == 0
+        && ToSetMaterial          == 0
+        && ToSetShowFreeBoundary  == 0
+        && ToSetFreeBoundaryColor == 0
+        && ToSetFreeBoundaryWidth == 0;
   }
 
   //! @return true if properties are valid
@@ -1451,6 +1467,12 @@ struct ViewerTest_AspectsChangeSet
       std::cout << "Error: unknown material " << MatName << ".\n";
       isOk = Standard_False;
     }
+    if (FreeBoundaryWidth <= 0.0
+     || FreeBoundaryWidth >  10.0)
+    {
+      std::cout << "Error: the free boundary width should be within [1; 10] range (specified " << FreeBoundaryWidth << ")\n";
+      isOk = Standard_False;
+    }
     return isOk;
   }
 
@@ -1474,6 +1496,7 @@ static Standard_Integer VAspects (Draw_Interpretor& /*theDI*/,
   }
 
   Standard_Integer anArgIter = 1;
+  Standard_Boolean isDefaults = Standard_False;
   NCollection_Sequence<TCollection_AsciiString> aNames;
   for (; anArgIter < theArgNb; ++anArgIter)
   {
@@ -1489,10 +1512,21 @@ static Standard_Integer VAspects (Draw_Interpretor& /*theDI*/,
     }
     else
     {
+      if (anArg == "-defaults")
+      {
+        isDefaults = Standard_True;
+        ++anArgIter;
+      }
       break;
     }
   }
 
+  if (!aNames.IsEmpty() && isDefaults)
+  {
+    std::cout << "Error: wrong syntax. If -defaults is used there should not be any objects' names!\n";
+    return 1;
+  }
+
   NCollection_Sequence<ViewerTest_AspectsChangeSet> aChanges;
   aChanges.Append (ViewerTest_AspectsChangeSet());
   ViewerTest_AspectsChangeSet* aChangeSet = &aChanges.ChangeLast();
@@ -1770,6 +1804,12 @@ static Standard_Integer VAspects (Draw_Interpretor& /*theDI*/,
     else if (anArg == "-subshape"
           || anArg == "-subshapes")
     {
+      if (isDefaults)
+      {
+        std::cout << "Error: wrong syntax. -subshapes can not be used together with -defaults call!\n";
+        return 1;
+      }
+
       if (aNames.IsEmpty())
       {
         std::cout << "Error: main objects should specified explicitly when -subshapes is used!\n";
@@ -1803,6 +1843,106 @@ static Standard_Integer VAspects (Draw_Interpretor& /*theDI*/,
         return 1;
       }
     }
+    else if (anArg == "-freeboundary"
+          || anArg == "-fb")
+    {
+      if (++anArgIter >= theArgNb)
+      {
+        std::cout << "Error: wrong syntax at " << anArg << "\n";
+        return 1;
+      }
+      TCollection_AsciiString aValue (theArgVec[anArgIter]);
+      aValue.LowerCase();
+      if (aValue == "on"
+       || aValue == "1")
+      {
+        aChangeSet->ToSetShowFreeBoundary = 1;
+      }
+      else if (aValue == "off"
+            || aValue == "0")
+      {
+        aChangeSet->ToSetShowFreeBoundary = -1;
+      }
+      else
+      {
+        std::cout << "Error: wrong syntax at " << anArg << "\n";
+        return 1;
+      }
+    }
+    else if (anArg == "-setfreeboundarywidth"
+          || anArg == "-setfbwidth")
+    {
+      if (++anArgIter >= theArgNb)
+      {
+        std::cout << "Error: wrong syntax at " << anArg << "\n";
+        return 1;
+      }
+      aChangeSet->ToSetFreeBoundaryWidth = 1;
+      aChangeSet->FreeBoundaryWidth = Draw::Atof (theArgVec[anArgIter]);
+    }
+    else if (anArg == "-unsetfreeboundarywidth"
+          || anArg == "-unsetfbwidth")
+    {
+      aChangeSet->ToSetFreeBoundaryWidth = -1;
+      aChangeSet->FreeBoundaryWidth = 1.0;
+    }
+    else if (anArg == "-setfreeboundarycolor"
+          || anArg == "-setfbcolor")
+    {
+      Standard_Integer aNbComps  = 0;
+      Standard_Integer aCompIter = anArgIter + 1;
+      for (; aCompIter < theArgNb; ++aCompIter, ++aNbComps)
+      {
+        if (theArgVec[aCompIter][0] == '-')
+        {
+          break;
+        }
+      }
+      switch (aNbComps)
+      {
+        case 1:
+        {
+          Quantity_NameOfColor aColor = Quantity_NOC_BLACK;
+          Standard_CString     aName  = theArgVec[anArgIter + 1];
+          if (!Quantity_Color::ColorFromName (aName, aColor))
+          {
+            std::cout << "Error: unknown free boundary color name '" << aName << "'\n";
+            return 1;
+          }
+          aChangeSet->FreeBoundaryColor = aColor;
+          break;
+        }
+        case 3:
+        {
+          Graphic3d_Vec3d anRgb;
+          anRgb.x() = Draw::Atof (theArgVec[anArgIter + 1]);
+          anRgb.y() = Draw::Atof (theArgVec[anArgIter + 2]);
+          anRgb.z() = Draw::Atof (theArgVec[anArgIter + 3]);
+          if (anRgb.x() < 0.0 || anRgb.x() > 1.0
+           || anRgb.y() < 0.0 || anRgb.y() > 1.0
+           || anRgb.z() < 0.0 || anRgb.z() > 1.0)
+          {
+            std::cout << "Error: free boundary RGB color values should be within range 0..1!\n";
+            return 1;
+          }
+          aChangeSet->FreeBoundaryColor.SetValues (anRgb.x(), anRgb.y(), anRgb.z(), Quantity_TOC_RGB);
+          break;
+        }
+        default:
+        {
+          std::cout << "Error: wrong syntax at " << anArg << "\n";
+          return 1;
+        }
+      }
+      aChangeSet->ToSetFreeBoundaryColor = 1;
+      anArgIter += aNbComps;
+    }
+    else if (anArg == "-unsetfreeboundarycolor"
+          || anArg == "-unsetfbcolor")
+    {
+      aChangeSet->ToSetFreeBoundaryColor = -1;
+      aChangeSet->FreeBoundaryColor = DEFAULT_FREEBOUNDARY_COLOR;
+    }
     else if (anArg == "-unset")
     {
       aChangeSet->ToSetVisibility = 1;
@@ -1815,6 +1955,11 @@ static Standard_Integer VAspects (Draw_Interpretor& /*theDI*/,
       aChangeSet->Color = DEFAULT_COLOR;
       aChangeSet->ToSetMaterial = -1;
       aChangeSet->Material = Graphic3d_NOM_DEFAULT;
+      aChangeSet->ToSetShowFreeBoundary = -1;
+      aChangeSet->ToSetFreeBoundaryColor = -1;
+      aChangeSet->FreeBoundaryColor = DEFAULT_FREEBOUNDARY_COLOR;
+      aChangeSet->ToSetFreeBoundaryWidth = -1;
+      aChangeSet->FreeBoundaryWidth = 1.0;
     }
     else
     {
@@ -1838,12 +1983,74 @@ static Standard_Integer VAspects (Draw_Interpretor& /*theDI*/,
   {
     aCtx->CloseLocalContext();
   }
+
+  // special case for -defaults parameter.
+  // all changed values will be set to DefaultDrawer.
+  if (isDefaults)
+  {
+    const Handle(Prs3d_Drawer)& aDrawer = aCtx->DefaultDrawer();
+
+    if (aChangeSet->ToSetLineWidth != 0)
+    {
+      aDrawer->LineAspect()->SetWidth (aChangeSet->LineWidth);
+      aDrawer->WireAspect()->SetWidth (aChangeSet->LineWidth);
+      aDrawer->UnFreeBoundaryAspect()->SetWidth (aChangeSet->LineWidth);
+      aDrawer->SeenLineAspect()->SetWidth (aChangeSet->LineWidth);
+    }
+    if (aChangeSet->ToSetColor != 0)
+    {
+      aDrawer->ShadingAspect()->SetColor        (aChangeSet->Color);
+      aDrawer->LineAspect()->SetColor           (aChangeSet->Color);
+      aDrawer->UnFreeBoundaryAspect()->SetColor (aChangeSet->Color);
+      aDrawer->SeenLineAspect()->SetColor       (aChangeSet->Color);
+      aDrawer->WireAspect()->SetColor           (aChangeSet->Color);
+      aDrawer->PointAspect()->SetColor          (aChangeSet->Color);
+    }
+    if (aChangeSet->ToSetTransparency != 0)
+    {
+      aDrawer->ShadingAspect()->SetTransparency (aChangeSet->Transparency);
+    }
+    if (aChangeSet->ToSetMaterial != 0)
+    {
+      aDrawer->ShadingAspect()->SetMaterial (aChangeSet->Material);
+    }
+    if (aChangeSet->ToSetShowFreeBoundary == 1)
+    {
+      aDrawer->SetFreeBoundaryDraw (Standard_True);
+    }
+    else if (aChangeSet->ToSetShowFreeBoundary == -1)
+    {
+      aDrawer->SetFreeBoundaryDraw (Standard_False);
+    }
+    if (aChangeSet->ToSetFreeBoundaryWidth != 0)
+    {
+      aDrawer->FreeBoundaryAspect()->SetWidth (aChangeSet->FreeBoundaryWidth);
+    }
+    if (aChangeSet->ToSetFreeBoundaryColor != 0)
+    {
+      aDrawer->FreeBoundaryAspect()->SetColor (aChangeSet->FreeBoundaryColor);
+    }
+
+    // redisplay all objects in context
+    for (ViewTest_PrsIter aPrsIter (aNames); aPrsIter.More(); aPrsIter.Next())
+    {
+      Handle(AIS_InteractiveObject)  aPrs = aPrsIter.Current();
+      if (!aPrs.IsNull())
+      {
+        aCtx->Redisplay (aPrs, Standard_False);
+      }
+    }
+    return 0;
+  }
+
   for (ViewTest_PrsIter aPrsIter (aNames); aPrsIter.More(); aPrsIter.Next())
   {
-    const TCollection_AsciiString& aName = aPrsIter.CurrentName();
-    Handle(AIS_InteractiveObject)  aPrs  = aPrsIter.Current();
+    const TCollection_AsciiString& aName   = aPrsIter.CurrentName();
+    Handle(AIS_InteractiveObject)  aPrs    = aPrsIter.Current();
+    Handle(Prs3d_Drawer)           aDrawer = aPrs->Attributes();
     Handle(AIS_ColoredShape) aColoredPrs;
     Standard_Boolean toDisplay = Standard_False;
+    Standard_Boolean toRedisplay = Standard_False;
     if (aChanges.Length() > 1 || aChangeSet->ToSetVisibility == 1)
     {
       Handle(AIS_Shape) aShapePrs = Handle(AIS_Shape)::DownCast (aPrs);
@@ -1906,6 +2113,37 @@ static Standard_Integer VAspects (Draw_Interpretor& /*theDI*/,
       {
         aCtx->UnsetWidth (aPrs, Standard_False);
       }
+      if (!aDrawer.IsNull())
+      {
+        if (aChangeSet->ToSetShowFreeBoundary == 1)
+        {
+          aDrawer->SetFreeBoundaryDraw (Standard_True);
+          toRedisplay = Standard_True;
+        }
+        else if (aChangeSet->ToSetShowFreeBoundary == -1)
+        {
+          aDrawer->SetFreeBoundaryDraw (Standard_False);
+          toRedisplay = Standard_True;
+        }
+        if (aChangeSet->ToSetFreeBoundaryWidth != 0)
+        {
+          Handle(Prs3d_LineAspect) aBoundaryAspect =
+              new Prs3d_LineAspect (Quantity_NOC_RED, Aspect_TOL_SOLID, 1.0);
+          *aBoundaryAspect->Aspect() = *aDrawer->FreeBoundaryAspect()->Aspect();
+          aBoundaryAspect->SetWidth (aChangeSet->FreeBoundaryWidth);
+          aDrawer->SetFreeBoundaryAspect (aBoundaryAspect);
+          toRedisplay = Standard_True;
+        }
+        if (aChangeSet->ToSetFreeBoundaryColor != 0)
+        {
+          Handle(Prs3d_LineAspect) aBoundaryAspect =
+              new Prs3d_LineAspect (Quantity_NOC_RED, Aspect_TOL_SOLID, 1.0);
+          *aBoundaryAspect->Aspect() = *aDrawer->FreeBoundaryAspect()->Aspect();
+          aBoundaryAspect->SetColor (aChangeSet->FreeBoundaryColor);
+          aDrawer->SetFreeBoundaryAspect (aBoundaryAspect);
+          toRedisplay = Standard_True;
+        }
+      }
 
       for (aChangesIter.Next(); aChangesIter.More(); aChangesIter.Next())
       {
@@ -1938,6 +2176,10 @@ static Standard_Integer VAspects (Draw_Interpretor& /*theDI*/,
       {
         aCtx->Display (aPrs, Standard_False);
       }
+      if (toRedisplay)
+      {
+        aCtx->Redisplay (aPrs, Standard_False);
+      }
       else if (!aColoredPrs.IsNull())
       {
         aColoredPrs->Redisplay();
@@ -4659,16 +4901,23 @@ void ViewerTest::Commands(Draw_Interpretor& theCommands)
                  __FILE__,VSubInt,group);
 
   theCommands.Add("vaspects",
-              "vaspects [-noupdate|-update] [name1 [name2 [...]]]"
+              "vaspects [-noupdate|-update] [name1 [name2 [...]] | -defaults]"
       "\n\t\t:          [-setvisibility 0|1]"
       "\n\t\t:          [-setcolor ColorName] [-setcolor R G B] [-unsetcolor]"
       "\n\t\t:          [-setmaterial MatName] [-unsetmaterial]"
       "\n\t\t:          [-settransparency Transp] [-unsettransparency]"
       "\n\t\t:          [-setwidth LineWidth] [-unsetwidth]"
+      "\n\t\t:          [-freeBoundary {off/on | 0/1}]"
+      "\n\t\t:          [-setFreeBoundaryWidth Width] [-unsetFreeBoundaryWidth]"
+      "\n\t\t:          [-setFreeBoundaryColor {ColorName | R G B}] [-unsetFreeBoundaryColor]"
       "\n\t\t:          [-subshapes subname1 [subname2 [...]]]"
       "\n\t\t: Manage presentation properties of all, selected or named objects."
       "\n\t\t: When -subshapes is specified than following properties will be"
-      "\n\t\t: assigned to specified sub-shapes.",
+      "\n\t\t: assigned to specified sub-shapes."
+      "\n\t\t: When -defaults is specified than presentation properties will be"
+      "\n\t\t: assigned to all objects that have not their own specified properties"
+      "\n\t\t: and to all objects to be displayed in the future."
+      "\n\t\t: If -defaults is used there should not be any objects' names and -subshapes specifier.",
                  __FILE__,VAspects,group);
 
   theCommands.Add("vsetcolor",
index 9a3c184..e422a01 100644 (file)
@@ -99,7 +99,6 @@
 #include <Standard_Real.hxx>
 
 #include <AIS_Circle.hxx>
-#include <AIS_Drawer.hxx>
 #include <BRepBuilderAPI_MakeEdge.hxx>
 #include <BRepBuilderAPI_MakeFace.hxx>
 #include <BRepBuilderAPI_MakeWire.hxx>
 #include <BRepExtrema_ExtPC.hxx>
 #include <BRepExtrema_ExtPF.hxx>
 
+#include <Prs3d_Drawer.hxx>
 #include <Prs3d_VertexDrawMode.hxx>
 #include <Prs3d_LineAspect.hxx>
 #include <Prs3d_PointAspect.hxx>
@@ -2514,10 +2514,13 @@ void MyTextClass::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresent
 
   aPresentation->Clear();
 
-  if (!myDrawer->HasTextAspect())
+  if (!myDrawer->HasOwnTextAspect())
   {
     myDrawer->SetTextAspect (new Prs3d_TextAspect());
-    *myDrawer->TextAspect()->Aspect() = *myDrawer->Link()->TextAspect()->Aspect();
+    if(myDrawer->HasLink())
+    {
+      *myDrawer->TextAspect()->Aspect() = *myDrawer->Link()->TextAspect()->Aspect();
+    }
   }
 
   Handle(Prs3d_TextAspect) asp = myDrawer->TextAspect();
@@ -3771,6 +3774,7 @@ static Standard_Integer VConnect (Draw_Interpretor& /*di*/,
         continue;
       }
       anObject = new AIS_Shape (aTDShape);
+      aContext->Load (anObject);
       anObject->SetColor (ViewerTest::GetColorFromName (aColorName));
     }
 
index add9728..0ae4df3 100644 (file)
@@ -15,7 +15,6 @@
 
 #include <ViewerTest.hxx>
 
-#include <AIS_Drawer.hxx>
 #include <AIS_InteractiveContext.hxx>
 #include <AIS_InteractiveObject.hxx>
 #include <Draw.hxx>
@@ -34,6 +33,7 @@
 #include <OpenGl_Workspace.hxx>
 #include <OSD_Environment.hxx>
 #include <OSD_File.hxx>
+#include <Prs3d_Drawer.hxx>
 #include <Prs3d_Presentation.hxx>
 #include <Prs3d_Root.hxx>
 #include <Prs3d_ShadingAspect.hxx>
index 03608ea..cd0a073 100644 (file)
@@ -16,7 +16,6 @@
 
 #include <OpenGl_GlCore20.hxx>
 #include <AIS_Shape.hxx>
-#include <AIS_Drawer.hxx>
 #include <AIS_InteractiveObject.hxx>
 #include <AIS_ListOfInteractive.hxx>
 #include <AIS_ListIteratorOfListOfInteractive.hxx>
@@ -73,6 +72,7 @@
 #include <NCollection_DataMap.hxx>
 #include <Graphic3d_Texture2Dmanual.hxx>
 #include <Prs3d_ShadingAspect.hxx>
+#include <Prs3d_Drawer.hxx>
 
 #ifdef WNT
 #undef DrawText
index 0f94f57..ad7f157 100644 (file)
@@ -21,7 +21,7 @@
 #include <gp_Pnt.hxx>
 #include <Graphic3d_AspectFillArea3d.hxx>
 #include <Graphic3d_AspectLine3d.hxx>
-#include <Handle_AIS_Drawer.hxx>
+#include <Prs3d_Drawer.hxx>
 #include <Prs3d_DimensionAspect.hxx>
 #include <Prs3d_IsoAspect.hxx>
 #include <Prs3d_LineAspect.hxx>
@@ -209,46 +209,67 @@ void XCAFPrs_AISObject::Compute (const Handle(PrsMgr_PresentationManager3d)& the
 //function : SetColors
 //purpose  :
 //=======================================================================
-void XCAFPrs_AISObject::SetColors (const Handle(AIS_Drawer)& theDrawer,
-                                   const Quantity_Color&     theColorCurv,
-                                   const Quantity_Color&     theColorSurf)
+void XCAFPrs_AISObject::SetColors (const Handle(Prs3d_Drawer)& theDrawer,
+                                   const Quantity_Color&       theColorCurv,
+                                   const Quantity_Color&       theColorSurf)
 {
-  if (!theDrawer->HasShadingAspect())
+  if (!theDrawer->HasOwnShadingAspect())
   {
     theDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
-    *theDrawer->ShadingAspect()->Aspect() = *theDrawer->Link()->ShadingAspect()->Aspect();
+    if (theDrawer->HasLink())
+    {
+      *theDrawer->ShadingAspect()->Aspect() = *theDrawer->Link()->ShadingAspect()->Aspect();
+    }
   }
-  if (!theDrawer->HasLineAspect())
+  if (!theDrawer->HasOwnLineAspect())
   {
     theDrawer->SetLineAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
-    *theDrawer->LineAspect()->Aspect() = *theDrawer->Link()->LineAspect()->Aspect();
+    if (theDrawer->HasLink())
+    {
+      *theDrawer->LineAspect()->Aspect() = *theDrawer->Link()->LineAspect()->Aspect();
+    }
   }
-  if (!theDrawer->HasWireAspect())
+  if (!theDrawer->HasOwnWireAspect())
   {
     theDrawer->SetWireAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
-    *theDrawer->WireAspect()->Aspect() = *theDrawer->Link()->WireAspect()->Aspect();
+    if (theDrawer->HasLink())
+    {
+      *theDrawer->WireAspect()->Aspect() = *theDrawer->Link()->WireAspect()->Aspect();
+    }
   }
-  if (!theDrawer->HasUIsoAspect())
+  if (!theDrawer->HasOwnUIsoAspect())
   {
     theDrawer->SetUIsoAspect (new Prs3d_IsoAspect (Quantity_NOC_GRAY75, Aspect_TOL_SOLID, 0.5, 1));
-    *theDrawer->UIsoAspect()->Aspect() = *theDrawer->Link()->UIsoAspect()->Aspect();
-    theDrawer->UIsoAspect()->SetNumber (theDrawer->Link()->UIsoAspect()->Number());
+    if (theDrawer->HasLink())
+    {
+      *theDrawer->UIsoAspect()->Aspect() = *theDrawer->Link()->UIsoAspect()->Aspect();
+      theDrawer->UIsoAspect()->SetNumber (theDrawer->Link()->UIsoAspect()->Number());
+    }
   }
-  if (!theDrawer->HasVIsoAspect())
+  if (!theDrawer->HasOwnVIsoAspect())
   {
     theDrawer->SetVIsoAspect (new Prs3d_IsoAspect (Quantity_NOC_GRAY75, Aspect_TOL_SOLID, 0.5, 1));
-    *theDrawer->VIsoAspect()->Aspect() = *theDrawer->Link()->VIsoAspect()->Aspect();
-    theDrawer->VIsoAspect()->SetNumber (theDrawer->Link()->VIsoAspect()->Number());
+    if (theDrawer->HasLink())
+    {
+      *theDrawer->VIsoAspect()->Aspect() = *theDrawer->Link()->VIsoAspect()->Aspect();
+      theDrawer->VIsoAspect()->SetNumber (theDrawer->Link()->VIsoAspect()->Number());
+    }
   }
-  if (!theDrawer->HasFreeBoundaryAspect())
+  if (!theDrawer->HasOwnFreeBoundaryAspect())
   {
     theDrawer->SetFreeBoundaryAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
-    *theDrawer->FreeBoundaryAspect()->Aspect() = *theDrawer->Link()->FreeBoundaryAspect()->Aspect();
+    if (theDrawer->HasLink())
+    {
+      *theDrawer->FreeBoundaryAspect()->Aspect() = *theDrawer->Link()->FreeBoundaryAspect()->Aspect();
+    }
   }
-  if (!theDrawer->HasUnFreeBoundaryAspect())
+  if (!theDrawer->HasOwnUnFreeBoundaryAspect())
   {
     theDrawer->SetUnFreeBoundaryAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
-    *theDrawer->UnFreeBoundaryAspect()->Aspect() = *theDrawer->Link()->UnFreeBoundaryAspect()->Aspect();
+    if (theDrawer->HasLink())
+    {
+      *theDrawer->UnFreeBoundaryAspect()->Aspect() = *theDrawer->Link()->UnFreeBoundaryAspect()->Aspect();
+    }
   }
 
   theDrawer->UnFreeBoundaryAspect()->SetColor (theColorCurv);
index de5e5e0..c213385 100644 (file)
@@ -36,9 +36,9 @@ protected:
                                          const Standard_Integer                      theMode);
 
   //! Set colors to drawer
-  Standard_EXPORT void SetColors (const Handle(AIS_Drawer)& theDrawer,
-                                  const Quantity_Color&     theColorCurv,
-                                  const Quantity_Color&     theColorSurf);
+  Standard_EXPORT void SetColors (const Handle(Prs3d_Drawer)& theDrawer,
+                                  const Quantity_Color&       theColorCurv,
+                                  const Quantity_Color&       theColorSurf);
 
   //! Fills out a default style object which is used when styles are
   //! not explicitly defined in the document.
index 0a688ed..eef41ee 100644 (file)
@@ -89,8 +89,8 @@
 #include <TColStd_HArray1OfReal.hxx>
 
 #include <AIS_InteractiveObject.hxx>
-#include <AIS_Drawer.hxx>
 #include <Aspect_TypeOfLine.hxx>
+#include <Prs3d_Drawer.hxx>
 #include <Prs3d_LineAspect.hxx>
 #include <TDocStd_Owner.hxx>
 #include <Geom_Axis2Placement.hxx>
@@ -953,7 +953,7 @@ static Standard_Integer XShowFaceBoundary (Draw_Interpretor& di,
   }
 
   // get drawer
-  const Handle(AIS_Drawer)& aDrawer = anInteractive->Attributes ();
+  const Handle(Prs3d_Drawer)& aDrawer = anInteractive->Attributes ();
 
   // default attributes
   Quantity_Parameter aRed      = 0.0;
diff --git a/tests/bugs/vis/bug25773 b/tests/bugs/vis/bug25773
new file mode 100644 (file)
index 0000000..e5ea2c4
--- /dev/null
@@ -0,0 +1,26 @@
+puts "============"
+puts "CR25773"
+puts "Check that properties of object can be applied to it (set to its drawer)"
+puts "============"
+puts ""
+
+vinit View1
+vclear
+
+vaspects -defaults -setfreeboundarycolor 0 0 1
+
+pcone c 0 5 10
+explode c F
+vdisplay c_1; vfit
+
+set x 80
+set y 103
+checkcolor $x $y 0 0 1
+
+vaspects c_1 -freeboundary off
+checkcolor $x $y 0 0 0
+
+vaspects c_1 -freeboundary on -setfreeboundarycolor 1 0 0 -setfreeboundarywidth 2
+checkcolor $x $y 1 0 0
+
+set only_screen 1