]> OCCT Git - occt-copy.git/commitdiff
0026885: Visualization - drop redundant aspects from structure level
authorkgv <kgv@opencascade.com>
Mon, 20 Jun 2016 16:10:51 +0000 (19:10 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 23 Jun 2016 15:14:58 +0000 (18:14 +0300)
Graphic3d_CStructure and OpenGl_Structure do not store structure aspects anymore.
Graphic3d_Structure, Prs3d_Presentation - structure aspect methods have been removed.

AIS_InteractiveObject::SetAspect() - globalChange argument has been removed.

Undocumented test methods V3d::DrawSphere(), ::SetPlane(), ::PickGrid() have been removed.

29 files changed:
dox/dev_guides/upgrade/upgrade.md
src/AIS/AIS_InteractiveContext.cxx
src/AIS/AIS_InteractiveContext.hxx
src/AIS/AIS_InteractiveObject.cxx
src/AIS/AIS_InteractiveObject.hxx
src/AIS/AIS_Manipulator.cxx
src/AIS/AIS_PointCloud.cxx
src/AIS/AIS_Shape.cxx
src/AIS/AIS_TexturedShape.cxx
src/Graphic3d/Graphic3d_CStructure.cxx
src/Graphic3d/Graphic3d_CStructure.hxx
src/Graphic3d/Graphic3d_Group.cxx
src/Graphic3d/Graphic3d_Structure.cxx
src/Graphic3d/Graphic3d_Structure.hxx
src/OpenGl/OpenGl_Structure.cxx
src/OpenGl/OpenGl_Structure.hxx
src/OpenGl/OpenGl_View_Raytrace.cxx
src/OpenGl/OpenGl_Workspace.cxx
src/Prs3d/Prs3d_Presentation.cxx
src/Prs3d/Prs3d_Presentation.hxx
src/PrsMgr/PrsMgr_Presentation.cxx
src/PrsMgr/PrsMgr_Presentation.hxx
src/PrsMgr/PrsMgr_PresentationManager.cxx
src/PrsMgr/PrsMgr_PresentationManager.hxx
src/V3d/V3d.cxx
src/V3d/V3d.hxx
src/V3d/V3d_Plane.cxx
src/ViewerTest/ViewerTest_ObjectCommands.cxx
src/ViewerTest/ViewerTest_OpenGlCommands.cxx

index a83cc5e19def908fcd002d6340b2a1e68d23963b..e2095b08fdefb8d26b9e9402df2d75ae57a8ef28 100644 (file)
@@ -990,4 +990,19 @@ Draw command *VSetTextureMode* has been deleted.
 
 2. Objects created with some constructors of *gp_Parab2d* class may differ from the previous version. Please see the updated documentation for *gp_Parab2d* class (file *gp_Parab2d.hxx*).
 
-3. The result returned by *gp_Parab2d::Directrix()* method has a different direction compared to the previous OCCT-version.
\ No newline at end of file
+3. Result returned by gp_Parab2d::Directrix() method has another direction in compare with previous OCCT-version.
+
+@subsection upgrade_710_aspects Presentation attributes
+
+This section should be considered if application defines custom presentations (inherited from AIS_InteractiveObject).
+Previous versions of OCCT have three levels for defining presentation properties (e.g. colors, materials):
+
+1. For entire structure (Graphic3d_Structure / Prs3d_Presentation).
+2. For specific group of primitives (Graphic3d_Group::SetGroupPrimitivesAspect()) overriding structure aspects.
+3. For specific primitive array within graphic group (Graphic3d_Group::SetPrimitivesAspect()).
+
+The first one is de facto not used for a long time since OCCT presentations always define aspects at graphic group level (overriding any structure aspects).
+Within this OCCT release, this first level of aspects has been completely removed. In most cases application code should just remove missing methods; in rare cases where this functionality was intentionally used - application should explicitly define aspects to appropriate graphic groups.
+
+Note that the 3rd level (defining several different aspects within the same graphic group) is also should be avoided in application code since it is deprecated functionality which can be removed in further releases.
+Graphic3d_Group::SetGroupPrimitivesAspect() should be the main method defining presentation attributes.
index 867005e249ef6e3bceef8b50e2e4f601f584fa4d..8e0041e315d8cf45052d426fbe0f225c8e1135b8 100644 (file)
@@ -2232,7 +2232,7 @@ void AIS_InteractiveContext::UnsetTransparency (const Handle(AIS_InteractiveObje
 //purpose  :
 //=======================================================================
 void AIS_InteractiveContext::SetSelectedAspect (const Handle(Prs3d_BasicAspect)& theAspect,
-                                                const Standard_Boolean           theIsGlobalChange,
+                                                const Standard_Boolean ,
                                                 const Standard_Boolean           theToUpdateViewer)
 {
   if (HasOpenedContext())
@@ -2245,7 +2245,7 @@ void AIS_InteractiveContext::SetSelectedAspect (const Handle(Prs3d_BasicAspect)&
   {
     isFound = Standard_True;
     Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (mySelection->Value());
-    anObj->SetAspect (theAspect, theIsGlobalChange);
+    anObj->SetAspect (theAspect);
   }
 
   if (isFound && theToUpdateViewer)
index a6a90d07963868c8c4ee275835f5eaea6bab877f..96a9db108816abef0a0b67071ee5de32720cd247 100644 (file)
@@ -850,10 +850,7 @@ public:
 
   //! Sets the graphic basic aspect to the current presentation of
   //! ALL selected objects.
-  //! When <globalChange> is TRUE , the full object presentation
-  //! is changed.
-  //! When <globalChange> is FALSE , only the current group
-  //! of the object presentation is changed.
+  //! Flag globalChange has no effect (left to simplify porting).
   //! Updates the viewer when <updateViewer> is TRUE
   Standard_EXPORT void SetSelectedAspect (const Handle(Prs3d_BasicAspect)& anAspect, const Standard_Boolean globalChange = Standard_True, const Standard_Boolean updateViewer = Standard_True);
   
index 80a9e793bc6c96e2f08c334ee68c9c239c5c7803..2440bdaa05995dae64cb7279a6ca4e5c88ea1361 100644 (file)
@@ -483,15 +483,14 @@ Handle(Prs3d_Presentation) AIS_InteractiveObject::Presentation() const
 //function : SetAspect 
 //purpose  : 
 //=======================================================================
-void AIS_InteractiveObject::SetAspect(const Handle(Prs3d_BasicAspect)& anAspect,
-                                     const Standard_Boolean globalChange) {
+void AIS_InteractiveObject::SetAspect(const Handle(Prs3d_BasicAspect)& anAspect)
+{
 
   if( HasPresentation() ) {
     Handle(Prs3d_Presentation) prs = Presentation();
     { Handle(Prs3d_ShadingAspect) aspect =
                        Handle(Prs3d_ShadingAspect)::DownCast(anAspect);
       if( !aspect.IsNull() ) {
-        if( globalChange ) prs->SetPrimitivesAspect(aspect->Aspect());
         Prs3d_Root::CurrentGroup(prs)->SetGroupPrimitivesAspect(aspect->Aspect());
         return;
       }
@@ -499,7 +498,6 @@ void AIS_InteractiveObject::SetAspect(const Handle(Prs3d_BasicAspect)& anAspect,
     { Handle(Prs3d_LineAspect) aspect =
                        Handle(Prs3d_LineAspect)::DownCast(anAspect);
       if( !aspect.IsNull() ) {
-        if( globalChange ) prs->SetPrimitivesAspect(aspect->Aspect());
         Prs3d_Root::CurrentGroup(prs)->SetGroupPrimitivesAspect(aspect->Aspect());
         return;
       }
@@ -507,7 +505,6 @@ void AIS_InteractiveObject::SetAspect(const Handle(Prs3d_BasicAspect)& anAspect,
     { Handle(Prs3d_PointAspect) aspect =
                        Handle(Prs3d_PointAspect)::DownCast(anAspect);
       if( !aspect.IsNull() ) {
-        if( globalChange ) prs->SetPrimitivesAspect(aspect->Aspect());
         Prs3d_Root::CurrentGroup(prs)->SetGroupPrimitivesAspect(aspect->Aspect());
         return;
       }
@@ -515,7 +512,6 @@ void AIS_InteractiveObject::SetAspect(const Handle(Prs3d_BasicAspect)& anAspect,
     { Handle(Prs3d_TextAspect) aspect =
                        Handle(Prs3d_TextAspect)::DownCast(anAspect);
       if( !aspect.IsNull() ) {
-        if( globalChange ) prs->SetPrimitivesAspect(aspect->Aspect());
         Prs3d_Root::CurrentGroup(prs)->SetGroupPrimitivesAspect(aspect->Aspect());
         return;
       }
@@ -543,7 +539,6 @@ void AIS_InteractiveObject::SetPolygonOffsets(const Standard_Integer    aMode,
     if ( !aPrs3d.IsNull() ) {
       const Handle(Graphic3d_Structure)& aStruct = aPrs3d->Presentation();
       if( !aStruct.IsNull() ) {
-        aStruct->SetPrimitivesAspect( myDrawer->ShadingAspect()->Aspect() );
         // Workaround for issue 23115: Need to update also groups, because their
         // face aspect ALWAYS overrides the structure's.
         const Graphic3d_SequenceOfGroup& aGroups = aStruct->Groups();
index 0b238be9680951702d55795ac834f949223d8988..5c2012cd95df1303dc80aa2eb9f99635447e6f0e 100644 (file)
@@ -410,13 +410,9 @@ public:
   //! Returns the current presentation of this object
   //! according to the current DisplayMode()
   Standard_EXPORT Handle(Prs3d_Presentation) Presentation() const;
-  
+
   //! Sets the graphic basic aspect to the current presentation.
-  //! When <globalChange> is TRUE , the full object presentation
-  //! is changed.
-  //! When <globalChange> is FALSE , only the current group
-  //! of the object presentation is changed.
-  Standard_EXPORT void SetAspect (const Handle(Prs3d_BasicAspect)& anAspect, const Standard_Boolean globalChange = Standard_True);
+  Standard_EXPORT void SetAspect (const Handle(Prs3d_BasicAspect)& anAspect);
   
   //! Sets up polygon offsets for this object.
   //! It modifies all existing presentations of <anObj> (if any),
index 2434229b6db1097e22f3981d47d848488d0fd3fa..6bc3bb09eb18e2f4c3d440503d1e255a2152e457 100644 (file)
@@ -878,7 +878,16 @@ void AIS_Manipulator::HilightOwnerWithColor (const Handle(PrsMgr_PresentationMan
     return;
   }
   aPresentation->Highlight (Aspect_TOHM_COLOR, theColor);
-  aPresentation->SetShadingAspect (myHighlightAspect);
+  for (Graphic3d_SequenceOfGroup::Iterator aGroupIter (aPresentation->Groups());
+       aGroupIter.More(); aGroupIter.Next())
+  {
+    Handle(Graphic3d_Group)& aGrp = aGroupIter.ChangeValue();
+    if (!aGrp.IsNull()
+     && aGrp->IsGroupPrimitivesAspectSet (Graphic3d_ASPECT_FILL_AREA))
+    {
+      aGrp->SetGroupPrimitivesAspect (myHighlightAspect->Aspect());
+    }
+  }
   aPresentation->SetZLayer (Graphic3d_ZLayerId_Topmost);
   thePM->AddToImmediateList (aPresentation);
 
index 46bc5061664b40e12d10aa7a93e3e9e42701f906..75a87aa5688708b208aa80d5d76acc3aeb8000ea 100644 (file)
@@ -41,6 +41,9 @@ IMPLEMENT_STANDARD_RTTIEXT(AIS_PointCloud,AIS_InteractiveObject)
 //==================================================
 AIS_PointCloud::AIS_PointCloud()
 {
+  // override default point style to Aspect_TOM_POINT
+  myDrawer->SetPointAspect (new Prs3d_PointAspect (Aspect_TOM_POINT, Quantity_NOC_YELLOW, 1.0));
+
   SetDisplayMode (AIS_PointCloud::DM_Points);
   SetHilightMode (AIS_PointCloud::DM_BndBox);
 }
@@ -187,12 +190,6 @@ void AIS_PointCloud::SetColor (const Quantity_Color& theColor)
     }
 
     const Handle(Prs3d_Presentation)& aPrs = aPrsModed.Presentation()->Presentation();
-
-    // Set aspects for presentation
-    aPrs->SetPrimitivesAspect (aPointAspect);
-    aPrs->SetPrimitivesAspect (anAreaAspect);
-
-    // Go through all groups to change color for all primitives
     for (Graphic3d_SequenceOfGroup::Iterator aGroupIt (aPrs->Groups()); aGroupIt.More(); aGroupIt.Next())
     {
       const Handle(Graphic3d_Group)& aGroup = aGroupIt.Value();
@@ -281,8 +278,6 @@ void AIS_PointCloud::UnsetColor()
     }
 
     const Handle(Prs3d_Presentation)& aPrs = aPrsModed.Presentation()->Presentation();
-    aPrs->SetPrimitivesAspect (anAreaAsp);
-    aPrs->SetPrimitivesAspect (aMarkerAsp);
     for (Graphic3d_SequenceOfGroup::Iterator aGroupIt (aPrs->Groups()); aGroupIt.More(); aGroupIt.Next())
     {
       const Handle(Graphic3d_Group)& aGroup = aGroupIt.Value();
@@ -346,7 +341,6 @@ void AIS_PointCloud::SetMaterial (const Graphic3d_MaterialAspect& theMat)
     }
 
     const Handle(Prs3d_Presentation)& aPrs = aPrsModed.Presentation()->Presentation();
-    aPrs->SetPrimitivesAspect (anAreaAsp);
     for (Graphic3d_SequenceOfGroup::Iterator aGroupIt (aPrs->Groups()); aGroupIt.More(); aGroupIt.Next())
     {
       const Handle(Graphic3d_Group)& aGroup = aGroupIt.Value();
@@ -401,7 +395,6 @@ void AIS_PointCloud::UnsetMaterial()
     }
 
     const Handle(Prs3d_Presentation)& aPrs = aPrsModed.Presentation()->Presentation();
-    aPrs->SetPrimitivesAspect (anAreaAsp);
     for (Graphic3d_SequenceOfGroup::Iterator aGroupIt (aPrs->Groups()); aGroupIt.More(); aGroupIt.Next())
     {
       const Handle(Graphic3d_Group)& aGroup = aGroupIt.Value();
@@ -432,14 +425,9 @@ void AIS_PointCloud::Compute (const Handle(PrsMgr_PresentationManager3d)& /*theP
         return;
       }
 
-      Handle(Graphic3d_AspectMarker3d) aMarkerAspect = myDrawer->PointAspect()->Aspect();
-      if (!myDrawer->HasOwnPointAspect())
-      {
-        aMarkerAspect->SetType (Aspect_TOM_POINT);
-      }
-
       Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (thePrs);
-      aGroup->SetGroupPrimitivesAspect (aMarkerAspect);
+      aGroup->SetGroupPrimitivesAspect (myDrawer->PointAspect()->Aspect());
+      aGroup->SetGroupPrimitivesAspect (myDrawer->ShadingAspect()->Aspect());
       aGroup->AddPrimitiveArray (aPoints);
       break;
     }
index c53664025f2ca0a09574e681f2186f253bd9329e..1004cfcccc18de693dee87d875cef8ef1e707511 100644 (file)
@@ -544,13 +544,6 @@ void AIS_Shape::SetColor (const Quantity_Color& theColor)
     }
 
     const Handle(Prs3d_Presentation)& aPrs = aPrsModed.Presentation()->Presentation();
-
-    // Set aspects for presentation
-    aPrs->SetPrimitivesAspect (anAreaAspect);
-    aPrs->SetPrimitivesAspect (aLineAspect);
-    aPrs->SetPrimitivesAspect (aPointAspect);
-
-    // Go through all groups to change color for all primitives
     for (Graphic3d_SequenceOfGroup::Iterator aGroupIt (aPrs->Groups()); aGroupIt.More(); aGroupIt.Next())
     {
       const Handle(Graphic3d_Group)& aGroup = aGroupIt.Value();
@@ -677,10 +670,6 @@ void AIS_Shape::UnsetColor()
     }
 
     const Handle(Prs3d_Presentation)& aPrs = aPrsModed.Presentation()->Presentation();
-
-    aPrs->SetPrimitivesAspect (anAreaAsp);
-    aPrs->SetPrimitivesAspect (aLineAsp);
-
     for (Graphic3d_SequenceOfGroup::Iterator aGroupIt (aPrs->Groups()); aGroupIt.More(); aGroupIt.Next())
     {
       const Handle(Graphic3d_Group)& aGroup = aGroupIt.Value();
@@ -878,7 +867,6 @@ void AIS_Shape::SetMaterial (const Graphic3d_MaterialAspect& theMat)
     }
 
     const Handle(Prs3d_Presentation)& aPrs = aPrsModed.Presentation()->Presentation();
-    aPrs->SetPrimitivesAspect (anAreaAsp);
     for (Graphic3d_SequenceOfGroup::Iterator aGroupIt (aPrs->Groups()); aGroupIt.More(); aGroupIt.Next())
     {
       const Handle(Graphic3d_Group)& aGroup = aGroupIt.Value();
@@ -941,7 +929,6 @@ void AIS_Shape::UnsetMaterial()
     }
 
     const Handle(Prs3d_Presentation)& aPrs = aPrsModed.Presentation()->Presentation();
-    aPrs->SetPrimitivesAspect (anAreaAsp);
     for (Graphic3d_SequenceOfGroup::Iterator aGroupIt (aPrs->Groups()); aGroupIt.More(); aGroupIt.Next())
     {
       const Handle(Graphic3d_Group)& aGroup = aGroupIt.Value();
@@ -999,7 +986,6 @@ void AIS_Shape::SetTransparency (const Standard_Real theValue)
     }
 
     const Handle(Prs3d_Presentation)& aPrs = aPrsModed.Presentation()->Presentation();
-    aPrs->SetPrimitivesAspect (anAreaAsp);
     aPrs->SetDisplayPriority (10); // force highest priority for translucent objects
     for (Graphic3d_SequenceOfGroup::Iterator aGroupIt (aPrs->Groups()); aGroupIt.More(); aGroupIt.Next())
     {
@@ -1048,7 +1034,6 @@ void AIS_Shape::UnsetTransparency()
     }
 
     const Handle(Prs3d_Presentation)& aPrs = aPrsModed.Presentation()->Presentation();
-    aPrs->SetPrimitivesAspect (anAreaAsp);
     for (Graphic3d_SequenceOfGroup::Iterator aGroupIt (aPrs->Groups()); aGroupIt.More(); aGroupIt.Next())
     {
       const Handle(Graphic3d_Group)& aGroup = aGroupIt.Value();
index a5b6593fcbbcf36a20611b40b34d9207d7aabf5a..362362dbce4d1c215ced0830823a58b4a3d591b6 100644 (file)
@@ -237,8 +237,6 @@ void AIS_TexturedShape::UnsetColor()
     Quantity_Color aColor;
     AIS_GraphicTool::GetInteriorColor (myDrawer->Link(), aColor);
     anAreaAsp->SetInteriorColor (aColor);
-    aPrs->SetPrimitivesAspect (anAreaAsp);
-    aPrs->SetPrimitivesAspect (aLineAsp);
     // Check if aspect of given type is set for the group, 
     // because setting aspect for group with no already set aspect
     // can lead to loss of presentation data
index 9fa9fe921246f65d0b841d81795762be95886e63..ecc6e8d23f71d9cdd2ceb0531683be152e9bf0bb 100644 (file)
@@ -42,14 +42,4 @@ Graphic3d_CStructure::Graphic3d_CStructure (const Handle(Graphic3d_StructureMana
   myGraphicDriver  (theManager->GraphicDriver())
 {
   Id = myGraphicDriver->NewIdentification();
-
-  ContextLine.IsDef     = 1,
-  ContextFillArea.IsDef = 1,
-  ContextMarker.IsDef   = 1,
-  ContextText.IsDef     = 1;
-
-  ContextLine.IsSet     = 0,
-  ContextFillArea.IsSet = 0,
-  ContextMarker.IsSet   = 0,
-  ContextText.IsSet     = 0;
 }
index cc2bee362525a8c6b35cb2b2b1e80c0cf727a3c6..5735fc958731de84f631e9548f83d4d060bb46af 100644 (file)
@@ -92,9 +92,6 @@ public:
   //! Disconnect other structure to this one
   virtual void Disconnect (Graphic3d_CStructure& theStructure) = 0;
 
-  //! Synchronize structure aspects
-  virtual void UpdateAspects() = 0;
-
   //! Synchronize structure transformation
   virtual void UpdateTransformation() = 0;
 
@@ -122,11 +119,6 @@ public:
   int                      Priority;
   int                      PreviousPriority;
 
-  CALL_DEF_CONTEXTLINE     ContextLine;
-  CALL_DEF_CONTEXTFILLAREA ContextFillArea;
-  CALL_DEF_CONTEXTMARKER   ContextMarker;
-  CALL_DEF_CONTEXTTEXT     ContextText;
-
   CALL_DEF_COLOR HighlightColor;
 
   Graphic3d_Mat4           Transformation;
index 3324956ac268393221ec4718fb371f9f90432dae..c4d99e11122676d9ce712267dc00acaad648062d 100644 (file)
@@ -822,7 +822,7 @@ void Graphic3d_Group::GroupPrimitivesAspect (const Handle(Graphic3d_AspectLine3d
   Quantity_Color aColor;
   Graphic3d_MaterialAspect aFront, aBack;
 
-  const CALL_DEF_CONTEXTLINE& anAspLine = ContextLine.IsSet ? ContextLine : myStructure->CStructure()->ContextLine;
+  const CALL_DEF_CONTEXTLINE& anAspLine = ContextLine;
   aColor.SetValues (Standard_Real (anAspLine.Color.r),
                     Standard_Real (anAspLine.Color.g),
                     Standard_Real (anAspLine.Color.b), Quantity_TOC_RGB);
@@ -831,7 +831,7 @@ void Graphic3d_Group::GroupPrimitivesAspect (const Handle(Graphic3d_AspectLine3d
   theAspLine->SetWidth         (Standard_Real     (anAspLine.Width));
   theAspLine->SetShaderProgram (anAspLine.ShaderProgram);
 
-  const CALL_DEF_CONTEXTTEXT& anAspText = ContextText.IsSet ? ContextText : myStructure->CStructure()->ContextText;
+  const CALL_DEF_CONTEXTTEXT& anAspText = ContextText;
   aColor.SetValues (Standard_Real (anAspText.Color.r),
                     Standard_Real (anAspText.Color.g),
                     Standard_Real (anAspText.Color.b), Quantity_TOC_RGB);
@@ -847,7 +847,7 @@ void Graphic3d_Group::GroupPrimitivesAspect (const Handle(Graphic3d_AspectLine3d
   theAspText->SetDisplayType     (Aspect_TypeOfDisplayText (anAspText.DisplayType));
   theAspText->SetShaderProgram   (anAspText.ShaderProgram);
 
-  const CALL_DEF_CONTEXTMARKER& anAspMarker = ContextMarker.IsSet ? ContextMarker : myStructure->CStructure()->ContextMarker;
+  const CALL_DEF_CONTEXTMARKER& anAspMarker = ContextMarker;
   aColor.SetValues (Standard_Real (anAspMarker.Color.r),
                     Standard_Real (anAspMarker.Color.g),
                     Standard_Real (anAspMarker.Color.b), Quantity_TOC_RGB);
@@ -860,7 +860,7 @@ void Graphic3d_Group::GroupPrimitivesAspect (const Handle(Graphic3d_AspectLine3d
     theAspMarker->SetMarkerImage (ContextMarker.MarkerImage);
   }
 
-  const CALL_DEF_CONTEXTFILLAREA& anAspFill = ContextFillArea.IsSet ? ContextFillArea : myStructure->CStructure()->ContextFillArea;
+  const CALL_DEF_CONTEXTFILLAREA& anAspFill = ContextFillArea;
   // Interior
   theAspFill->SetInteriorStyle (Aspect_InteriorStyle (anAspFill.Style));
   aColor.SetValues (Standard_Real (anAspFill.IntColor.r),
index 99cf4edd148bdc782ce57c165e33c15a3c9df91e..ba62c2bb0836ded1d62faf47486dec137e6fbf8d 100644 (file)
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
+#include <Graphic3d_Structure.hxx>
 
-#include <Aspect_PolygonOffsetMode.hxx>
 #include <Bnd_Box.hxx>
 #include <gp_Pnt.hxx>
-#include <Graphic3d_AspectFillArea3d.hxx>
-#include <Graphic3d_AspectLine3d.hxx>
-#include <Graphic3d_AspectMarker3d.hxx>
-#include <Graphic3d_AspectText3d.hxx>
 #include <Graphic3d_DataStructureManager.hxx>
 #include <Graphic3d_GraphicDriver.hxx>
 #include <Graphic3d_Group.hxx>
 #include <Graphic3d_MapIteratorOfMapOfStructure.hxx>
 #include <Graphic3d_MapOfStructure.hxx>
-#include <Graphic3d_MaterialAspect.hxx>
 #include <Graphic3d_PriorityDefinitionError.hxx>
-#include <Graphic3d_Structure.hxx>
-#include "Graphic3d_Structure.pxx"
 #include <Graphic3d_StructureDefinitionError.hxx>
 #include <Graphic3d_StructureManager.hxx>
-#include <Graphic3d_TextureMap.hxx>
 #include <Graphic3d_TransformError.hxx>
 #include <Graphic3d_Vector.hxx>
 #include <Quantity_Color.hxx>
 #include <Standard_Type.hxx>
 #include <TColStd_Array2OfReal.hxx>
 
+#include "Graphic3d_Structure.pxx"
+
 #include <stdio.h>
+
 IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_Structure,MMgt_TShared)
 
 //=============================================================================
@@ -56,17 +51,6 @@ Graphic3d_Structure::Graphic3d_Structure (const Handle(Graphic3d_StructureManage
   myVisual                (Graphic3d_TOS_ALL)
 {
   myCStructure = theManager->GraphicDriver()->CreateStructure (theManager);
-
-  // default aspects
-  Handle(Graphic3d_AspectLine3d)     aAspectLine3d     = new Graphic3d_AspectLine3d();
-  Handle(Graphic3d_AspectText3d)     aAspectText3d     = new Graphic3d_AspectText3d();
-  Handle(Graphic3d_AspectMarker3d)   aAspectMarker3d   = new Graphic3d_AspectMarker3d();
-  Handle(Graphic3d_AspectFillArea3d) aAspectFillArea3d = new Graphic3d_AspectFillArea3d();
-  theManager->PrimitivesAspect (aAspectLine3d, aAspectText3d, aAspectMarker3d, aAspectFillArea3d);
-  aAspectFillArea3d->SetPolygonOffsets (Aspect_POM_Fill, 1.0, 0.0);
-
-  // update the associated CStructure
-  UpdateStructure (aAspectLine3d, aAspectText3d, aAspectMarker3d, aAspectFillArea3d);
 }
 
 //=============================================================================
@@ -84,17 +68,6 @@ Graphic3d_Structure::Graphic3d_Structure (const Handle(Graphic3d_StructureManage
   myVisual                (thePrs->myVisual)
 {
   myCStructure = thePrs->myCStructure->ShadowLink (theManager);
-
-  // default aspects
-  Handle(Graphic3d_AspectLine3d)     aAspectLine3d     = new Graphic3d_AspectLine3d();
-  Handle(Graphic3d_AspectText3d)     aAspectText3d     = new Graphic3d_AspectText3d();
-  Handle(Graphic3d_AspectMarker3d)   aAspectMarker3d   = new Graphic3d_AspectMarker3d();
-  Handle(Graphic3d_AspectFillArea3d) aAspectFillArea3d = new Graphic3d_AspectFillArea3d();
-  theManager->PrimitivesAspect (aAspectLine3d, aAspectText3d, aAspectMarker3d, aAspectFillArea3d);
-  aAspectFillArea3d->SetPolygonOffsets (Aspect_POM_Fill, 1.0, 0.0);
-
-  // update the associated CStructure
-  UpdateStructure (aAspectLine3d, aAspectText3d, aAspectMarker3d, aAspectFillArea3d);
 }
 
 //=============================================================================
@@ -501,21 +474,6 @@ Standard_Boolean Graphic3d_Structure::IsEmpty() const
   return Standard_True;
 }
 
-//=============================================================================
-//function : PrimitivesAspect
-//purpose  :
-//=============================================================================
-void Graphic3d_Structure::PrimitivesAspect (Handle(Graphic3d_AspectLine3d)&     theAspLine,
-                                            Handle(Graphic3d_AspectText3d)&     theAspText,
-                                            Handle(Graphic3d_AspectMarker3d)&   theAspMarker,
-                                            Handle(Graphic3d_AspectFillArea3d)& theAspFill) const
-{
-  theAspLine   = Line3dAspect();
-  theAspText   = Text3dAspect();
-  theAspMarker = Marker3dAspect();
-  theAspFill   = FillArea3dAspect();
-}
-
 //=============================================================================
 //function : GroupsWithFacet
 //purpose  :
@@ -664,229 +622,6 @@ void Graphic3d_Structure::GraphicDisconnect (const Handle(Graphic3d_Structure)&
   myCStructure->Disconnect (*theDaughter->myCStructure);
 }
 
-//=============================================================================
-//function : Line3dAspect
-//purpose  :
-//=============================================================================
-Handle(Graphic3d_AspectLine3d) Graphic3d_Structure::Line3dAspect() const
-{
-  const Standard_Real anRGB[3] =
-  {
-    Standard_Real (myCStructure->ContextLine.Color.r),
-    Standard_Real (myCStructure->ContextLine.Color.g),
-    Standard_Real (myCStructure->ContextLine.Color.b)
-  };
-  Quantity_Color aColor;
-  aColor.SetValues (anRGB[0], anRGB[1], anRGB[2], Quantity_TOC_RGB);
-  Aspect_TypeOfLine aLType = Aspect_TypeOfLine (myCStructure->ContextLine.LineType);
-  Standard_Real     aWidth = Standard_Real     (myCStructure->ContextLine.Width);
-
-  Handle(Graphic3d_AspectLine3d) anAspLine = new Graphic3d_AspectLine3d (aColor, aLType, aWidth);
-  anAspLine->SetShaderProgram (myCStructure->ContextLine.ShaderProgram);
-  return anAspLine;
-}
-
-//=============================================================================
-//function : Text3dAspect
-//purpose  :
-//=============================================================================
-Handle(Graphic3d_AspectText3d) Graphic3d_Structure::Text3dAspect() const
-{
-  const Standard_Real anRGB[3] =
-  {
-    Standard_Real (myCStructure->ContextText.Color.r),
-    Standard_Real (myCStructure->ContextText.Color.g),
-    Standard_Real (myCStructure->ContextText.Color.b)
-  };
-  Quantity_Color aColor;
-  aColor.SetValues (anRGB[0], anRGB[1], anRGB[2], Quantity_TOC_RGB);
-  Standard_CString         aFont       = Standard_CString         (myCStructure->ContextText.Font);
-  Standard_Real            anExpansion = Standard_Real            (myCStructure->ContextText.Expan);
-  Standard_Real            aSpace      = Standard_Real            (myCStructure->ContextText.Space);
-  Aspect_TypeOfStyleText   aStyle      = Aspect_TypeOfStyleText   (myCStructure->ContextText.Style);
-  Aspect_TypeOfDisplayText aDispType   = Aspect_TypeOfDisplayText (myCStructure->ContextText.DisplayType);
-
-  Handle(Graphic3d_AspectText3d) anAspText = new Graphic3d_AspectText3d (aColor, aFont, anExpansion, aSpace, aStyle, aDispType);
-  anAspText->SetShaderProgram (myCStructure->ContextText.ShaderProgram);
-  return anAspText;
-}
-
-//=============================================================================
-//function : Marker3dAspect
-//purpose  :
-//=============================================================================
-Handle(Graphic3d_AspectMarker3d) Graphic3d_Structure::Marker3dAspect() const
-{
-  const Standard_Real anRGB[3] =
-  {
-    Standard_Real (myCStructure->ContextMarker.Color.r),
-    Standard_Real (myCStructure->ContextMarker.Color.g),
-    Standard_Real (myCStructure->ContextMarker.Color.b)
-  };
-  Quantity_Color aColor;
-  aColor.SetValues (anRGB[0], anRGB[1], anRGB[2], Quantity_TOC_RGB);
-  Aspect_TypeOfMarker aMType = myCStructure->ContextMarker.MarkerType;
-  Standard_Real       aScale = Standard_Real (myCStructure->ContextMarker.Scale);
-
-  Handle(Graphic3d_AspectMarker3d) anAspMarker = new Graphic3d_AspectMarker3d (aMType, aColor, aScale);
-  anAspMarker->SetShaderProgram (myCStructure->ContextMarker.ShaderProgram);
-  return anAspMarker;
-}
-
-//=============================================================================
-//function : FillArea3dAspect
-//purpose  :
-//=============================================================================
-Handle(Graphic3d_AspectFillArea3d) Graphic3d_Structure::FillArea3dAspect() const
-{
-  // Back Material
-  Graphic3d_MaterialAspect aBack;
-  aBack.SetShininess    (Standard_Real (myCStructure->ContextFillArea.Back.Shininess));
-  aBack.SetAmbient      (Standard_Real (myCStructure->ContextFillArea.Back.Ambient));
-  aBack.SetDiffuse      (Standard_Real (myCStructure->ContextFillArea.Back.Diffuse));
-  aBack.SetSpecular     (Standard_Real (myCStructure->ContextFillArea.Back.Specular));
-  aBack.SetTransparency (Standard_Real (myCStructure->ContextFillArea.Back.Transparency));
-  aBack.SetEmissive     (Standard_Real (myCStructure->ContextFillArea.Back.Emission));
-  if (myCStructure->ContextFillArea.Back.IsAmbient == 1)
-    aBack.SetReflectionModeOn  (Graphic3d_TOR_AMBIENT);
-  else
-    aBack.SetReflectionModeOff (Graphic3d_TOR_AMBIENT);
-  if (myCStructure->ContextFillArea.Back.IsDiffuse == 1)
-    aBack.SetReflectionModeOn  (Graphic3d_TOR_DIFFUSE);
-  else
-    aBack.SetReflectionModeOff (Graphic3d_TOR_DIFFUSE);
-  if (myCStructure->ContextFillArea.Back.IsSpecular == 1)
-    aBack.SetReflectionModeOn  (Graphic3d_TOR_SPECULAR);
-  else
-    aBack.SetReflectionModeOff (Graphic3d_TOR_SPECULAR);
-  if (myCStructure->ContextFillArea.Back.IsEmission == 1)
-    aBack.SetReflectionModeOn  (Graphic3d_TOR_EMISSION);
-  else
-    aBack.SetReflectionModeOff (Graphic3d_TOR_EMISSION);
-
-  Quantity_Color aColor (Standard_Real (myCStructure->ContextFillArea.Back.ColorSpec.r),
-                         Standard_Real (myCStructure->ContextFillArea.Back.ColorSpec.g),
-                         Standard_Real (myCStructure->ContextFillArea.Back.ColorSpec.b), Quantity_TOC_RGB);
-  aBack.SetSpecularColor (aColor);
-
-  aColor.SetValues (Standard_Real (myCStructure->ContextFillArea.Back.ColorAmb.r),
-                    Standard_Real (myCStructure->ContextFillArea.Back.ColorAmb.g),
-                    Standard_Real (myCStructure->ContextFillArea.Back.ColorAmb.b), Quantity_TOC_RGB);
-  aBack.SetAmbientColor (aColor);
-
-  aColor.SetValues (Standard_Real (myCStructure->ContextFillArea.Back.ColorDif.r),
-                    Standard_Real (myCStructure->ContextFillArea.Back.ColorDif.g),
-                    Standard_Real (myCStructure->ContextFillArea.Back.ColorDif.b), Quantity_TOC_RGB);
-  aBack.SetDiffuseColor (aColor);
-
-  aColor.SetValues (Standard_Real (myCStructure->ContextFillArea.Back.ColorEms.r),
-                    Standard_Real (myCStructure->ContextFillArea.Back.ColorEms.g),
-                    Standard_Real (myCStructure->ContextFillArea.Back.ColorEms.b), Quantity_TOC_RGB);
-  aBack.SetEmissiveColor (aColor);
-
-  aBack.SetEnvReflexion (myCStructure->ContextFillArea.Back.EnvReflexion);
-  aBack.SetMaterialType (myCStructure->ContextFillArea.Back.IsPhysic ? Graphic3d_MATERIAL_PHYSIC : Graphic3d_MATERIAL_ASPECT);
-
-  aBack.SetRefractionIndex (Standard_Real (myCStructure->ContextFillArea.Back.RefractionIndex));
-  aBack.SetBSDF (myCStructure->ContextFillArea.Back.BSDF);
-
-  // Front Material
-  Graphic3d_MaterialAspect aFront;
-  aFront.SetShininess    (Standard_Real (myCStructure->ContextFillArea.Front.Shininess));
-  aFront.SetAmbient      (Standard_Real (myCStructure->ContextFillArea.Front.Ambient));
-  aFront.SetDiffuse      (Standard_Real (myCStructure->ContextFillArea.Front.Diffuse));
-  aFront.SetSpecular     (Standard_Real (myCStructure->ContextFillArea.Front.Specular));
-  aFront.SetTransparency (Standard_Real (myCStructure->ContextFillArea.Front.Transparency));
-  aFront.SetEmissive     (Standard_Real (myCStructure->ContextFillArea.Front.Emission));
-  if (myCStructure->ContextFillArea.Front.IsAmbient == 1)
-    aFront.SetReflectionModeOn  (Graphic3d_TOR_AMBIENT);
-  else
-    aFront.SetReflectionModeOff (Graphic3d_TOR_AMBIENT);
-  if (myCStructure->ContextFillArea.Front.IsDiffuse == 1)
-    aFront.SetReflectionModeOn  (Graphic3d_TOR_DIFFUSE);
-  else
-    aFront.SetReflectionModeOff (Graphic3d_TOR_DIFFUSE);
-  if (myCStructure->ContextFillArea.Front.IsSpecular == 1)
-    aFront.SetReflectionModeOn  (Graphic3d_TOR_SPECULAR);
-  else
-    aFront.SetReflectionModeOff (Graphic3d_TOR_SPECULAR);
-  if (myCStructure->ContextFillArea.Front.Emission == 1)
-    aFront.SetReflectionModeOn  (Graphic3d_TOR_EMISSION);
-  else
-    aFront.SetReflectionModeOff (Graphic3d_TOR_EMISSION);
-
-  aColor.SetValues (Standard_Real (myCStructure->ContextFillArea.Front.ColorSpec.r),
-                    Standard_Real (myCStructure->ContextFillArea.Front.ColorSpec.g),
-                    Standard_Real (myCStructure->ContextFillArea.Front.ColorSpec.b), Quantity_TOC_RGB);
-  aFront.SetSpecularColor (aColor);
-
-  aColor.SetValues (Standard_Real (myCStructure->ContextFillArea.Front.ColorAmb.r),
-                    Standard_Real (myCStructure->ContextFillArea.Front.ColorAmb.g),
-                    Standard_Real (myCStructure->ContextFillArea.Front.ColorAmb.b), Quantity_TOC_RGB);
-  aFront.SetAmbientColor (aColor);
-
-  aColor.SetValues (Standard_Real (myCStructure->ContextFillArea.Front.ColorDif.r),
-                    Standard_Real (myCStructure->ContextFillArea.Front.ColorDif.g),
-                    Standard_Real (myCStructure->ContextFillArea.Front.ColorDif.b), Quantity_TOC_RGB);
-  aFront.SetDiffuseColor (aColor);
-
-  aColor.SetValues (Standard_Real (myCStructure->ContextFillArea.Front.ColorEms.r),
-                    Standard_Real (myCStructure->ContextFillArea.Front.ColorEms.g),
-                    Standard_Real (myCStructure->ContextFillArea.Front.ColorEms.b), Quantity_TOC_RGB);
-  aFront.SetEmissiveColor (aColor);
-
-  aFront.SetEnvReflexion (myCStructure->ContextFillArea.Front.EnvReflexion);
-  aFront.SetMaterialType (myCStructure->ContextFillArea.Front.IsPhysic ? Graphic3d_MATERIAL_PHYSIC : Graphic3d_MATERIAL_ASPECT);
-
-  aFront.SetRefractionIndex (Standard_Real (myCStructure->ContextFillArea.Front.RefractionIndex));
-  aFront.SetBSDF (myCStructure->ContextFillArea.Front.BSDF);
-
-  Quantity_Color anIntColor  (Standard_Real (myCStructure->ContextFillArea.IntColor.r),
-                              Standard_Real (myCStructure->ContextFillArea.IntColor.g),
-                              Standard_Real (myCStructure->ContextFillArea.IntColor.b), Quantity_TOC_RGB);
-  Quantity_Color anEdgeColor (Standard_Real (myCStructure->ContextFillArea.EdgeColor.r),
-                              Standard_Real (myCStructure->ContextFillArea.EdgeColor.g),
-                              Standard_Real (myCStructure->ContextFillArea.EdgeColor.b), Quantity_TOC_RGB);
-  Handle(Graphic3d_AspectFillArea3d) anAspFill = new Graphic3d_AspectFillArea3d (Aspect_InteriorStyle (myCStructure->ContextFillArea.Style),
-                                                                                 anIntColor, anEdgeColor,
-                                                                                 Aspect_TypeOfLine    (myCStructure->ContextFillArea.LineType),
-                                                                                 Standard_Real        (myCStructure->ContextFillArea.Width),
-                                                                                 aFront, aBack);
-
-  // Edges
-  if (myCStructure->ContextFillArea.Edge == 1)
-    anAspFill->SetEdgeOn();
-  else
-    anAspFill->SetEdgeOff();
-  // Hatch
-  anAspFill->SetHatchStyle (Aspect_HatchStyle (myCStructure->ContextFillArea.Hatch));
-  // Materials
-  // Front and Back face
-  if (myCStructure->ContextFillArea.Distinguish == 1)
-    anAspFill->SetDistinguishOn();
-  else
-    anAspFill->SetDistinguishOff();
-  if (myCStructure->ContextFillArea.BackFace == 1)
-    anAspFill->SuppressBackFace();
-  else
-    anAspFill->AllowBackFace();
-  // Texture
-  anAspFill->SetTextureMap (myCStructure->ContextFillArea.Texture.TextureMap);
-  if (myCStructure->ContextFillArea.Texture.doTextureMap == 1)
-  {
-    anAspFill->SetTextureMapOn();
-  }
-  else
-  {
-    anAspFill->SetTextureMapOff();
-  }
-  anAspFill->SetShaderProgram  (myCStructure->ContextFillArea.ShaderProgram);
-  anAspFill->SetPolygonOffsets (myCStructure->ContextFillArea.PolygonOffsetMode,
-                                myCStructure->ContextFillArea.PolygonOffsetFactor,
-                                myCStructure->ContextFillArea.PolygonOffsetUnits);
-  return anAspFill;
-}
-
 //=============================================================================
 //function : Groups
 //purpose  :
@@ -905,273 +640,6 @@ Standard_Integer Graphic3d_Structure::NumberOfGroups() const
   return myCStructure->Groups().Length();
 }
 
-//=============================================================================
-//function : SetPrimitivesAspect
-//purpose  :
-//=============================================================================
-void Graphic3d_Structure::SetPrimitivesAspect (const Handle(Graphic3d_AspectLine3d)& theAspLine)
-{
-  if (IsDeleted()) return;
-
-  Standard_Real     aWidth;
-  Quantity_Color    aColor;
-  Aspect_TypeOfLine aLType;
-  theAspLine->Values (aColor, aLType, aWidth);
-
-  myCStructure->ContextLine.Color.r        = float (aColor.Red());
-  myCStructure->ContextLine.Color.g        = float (aColor.Green());
-  myCStructure->ContextLine.Color.b        = float (aColor.Blue());
-  myCStructure->ContextLine.LineType       = int   (aLType);
-  myCStructure->ContextLine.Width          = float (aWidth);
-  myCStructure->ContextLine.ShaderProgram  = theAspLine->ShaderProgram();
-  myCStructure->ContextLine.IsDef          = 1;
-
-  myCStructure->UpdateAspects();
-
-  // Attributes are "IsSet" during the first update of context (line, marker...)
-  myCStructure->ContextLine.IsSet     = 1;
-  myCStructure->ContextFillArea.IsSet = 1;
-  myCStructure->ContextMarker.IsSet   = 1;
-  myCStructure->ContextText.IsSet     = 1;
-
-  Update();
-}
-
-//=============================================================================
-//function : SetPrimitivesAspect
-//purpose  :
-//=============================================================================
-void Graphic3d_Structure::SetPrimitivesAspect (const Handle(Graphic3d_AspectFillArea3d)& theAspFill)
-{
-  if (IsDeleted()) return;
-
-  Standard_Real        anRGB[3];
-  Standard_Real        aWidth;
-  Quantity_Color       anIntColor;
-  Quantity_Color       aBackIntColor;
-  Quantity_Color       anEdgeColor;
-  Aspect_TypeOfLine    aLType;
-  Aspect_InteriorStyle aStyle;
-  theAspFill->Values (aStyle, anIntColor, aBackIntColor, anEdgeColor, aLType, aWidth);
-
-  anIntColor.Values (anRGB[0], anRGB[1], anRGB[2], Quantity_TOC_RGB);
-  myCStructure->ContextFillArea.Style      = aStyle;
-  myCStructure->ContextFillArea.IntColor.r = float (anRGB[0]);
-  myCStructure->ContextFillArea.IntColor.g = float (anRGB[1]);
-  myCStructure->ContextFillArea.IntColor.b = float (anRGB[2]);
-
-  if (theAspFill->Distinguish())
-  {
-    aBackIntColor.Values (anRGB[0], anRGB[1], anRGB[2], Quantity_TOC_RGB);
-  }
-  myCStructure->ContextFillArea.BackIntColor.r = float(anRGB[0]);
-  myCStructure->ContextFillArea.BackIntColor.g = float(anRGB[1]);
-  myCStructure->ContextFillArea.BackIntColor.b = float(anRGB[2]);
-
-  // Edges
-  myCStructure->ContextFillArea.Edge        = theAspFill->Edge () ? 1 : 0;
-  myCStructure->ContextFillArea.EdgeColor.r = float (anEdgeColor.Red());
-  myCStructure->ContextFillArea.EdgeColor.g = float (anEdgeColor.Green());
-  myCStructure->ContextFillArea.EdgeColor.b = float (anEdgeColor.Blue());
-  myCStructure->ContextFillArea.LineType    = aLType;
-  myCStructure->ContextFillArea.Width       = float (aWidth);
-  myCStructure->ContextFillArea.Hatch       = theAspFill->HatchStyle();
-
-  // Front and Back face
-  myCStructure->ContextFillArea.Distinguish = theAspFill->Distinguish() ? 1 : 0;
-  myCStructure->ContextFillArea.BackFace    = theAspFill->BackFace()    ? 1 : 0;
-
-  // Back Material
-  const Graphic3d_MaterialAspect& aBack = theAspFill->BackMaterial();
-  // Light specificity
-  myCStructure->ContextFillArea.Back.Shininess       = float (aBack.Shininess());
-  myCStructure->ContextFillArea.Back.Ambient         = float (aBack.Ambient());
-  myCStructure->ContextFillArea.Back.Diffuse         = float (aBack.Diffuse());
-  myCStructure->ContextFillArea.Back.Specular        = float (aBack.Specular());
-  myCStructure->ContextFillArea.Back.Transparency    = float (aBack.Transparency());
-  myCStructure->ContextFillArea.Back.RefractionIndex = float (aBack.RefractionIndex());
-  myCStructure->ContextFillArea.Back.BSDF            = aBack.BSDF();
-  myCStructure->ContextFillArea.Back.Emission        = float (aBack.Emissive());
-
-  // Reflection mode
-  myCStructure->ContextFillArea.Back.IsAmbient    = (aBack.ReflectionMode (Graphic3d_TOR_AMBIENT)  ? 1 : 0);
-  myCStructure->ContextFillArea.Back.IsDiffuse    = (aBack.ReflectionMode (Graphic3d_TOR_DIFFUSE)  ? 1 : 0);
-  myCStructure->ContextFillArea.Back.IsSpecular   = (aBack.ReflectionMode (Graphic3d_TOR_SPECULAR) ? 1 : 0);
-  myCStructure->ContextFillArea.Back.IsEmission   = (aBack.ReflectionMode (Graphic3d_TOR_EMISSION) ? 1 : 0);
-
-  // Material type
-  //JR/Hp
-  myCStructure->ContextFillArea.Back.IsPhysic = (aBack.MaterialType (Graphic3d_MATERIAL_PHYSIC) ? 1 : 0 );
-
-  // Specular Color
-  myCStructure->ContextFillArea.Back.ColorSpec.r  = float (aBack.SpecularColor().Red());
-  myCStructure->ContextFillArea.Back.ColorSpec.g  = float (aBack.SpecularColor().Green());
-  myCStructure->ContextFillArea.Back.ColorSpec.b  = float (aBack.SpecularColor().Blue());
-
-  // Ambient color
-  myCStructure->ContextFillArea.Back.ColorAmb.r   = float (aBack.AmbientColor().Red());
-  myCStructure->ContextFillArea.Back.ColorAmb.g   = float (aBack.AmbientColor().Green());
-  myCStructure->ContextFillArea.Back.ColorAmb.b   = float (aBack.AmbientColor().Blue());
-
-  // Diffuse color
-  myCStructure->ContextFillArea.Back.ColorDif.r   = float (aBack.DiffuseColor().Red());
-  myCStructure->ContextFillArea.Back.ColorDif.g   = float (aBack.DiffuseColor().Green());
-  myCStructure->ContextFillArea.Back.ColorDif.b   = float (aBack.DiffuseColor().Blue());
-
-  // Emissive color
-  myCStructure->ContextFillArea.Back.ColorEms.r   = float (aBack.EmissiveColor().Red());
-  myCStructure->ContextFillArea.Back.ColorEms.g   = float (aBack.EmissiveColor().Green());
-  myCStructure->ContextFillArea.Back.ColorEms.b   = float (aBack.EmissiveColor().Blue());
-
-  myCStructure->ContextFillArea.Back.EnvReflexion =
-    float ((theAspFill->BackMaterial ()).EnvReflexion());
-
-  // Front Material
-  const Graphic3d_MaterialAspect& aFront = theAspFill->FrontMaterial();
-  // Light specificity
-  myCStructure->ContextFillArea.Front.Shininess       = float (aFront.Shininess());
-  myCStructure->ContextFillArea.Front.Ambient         = float (aFront.Ambient());
-  myCStructure->ContextFillArea.Front.Diffuse         = float (aFront.Diffuse());
-  myCStructure->ContextFillArea.Front.Specular        = float (aFront.Specular());
-  myCStructure->ContextFillArea.Front.Transparency    = float (aFront.Transparency());
-  myCStructure->ContextFillArea.Front.RefractionIndex = float (aFront.RefractionIndex());
-  myCStructure->ContextFillArea.Front.BSDF            = aFront.BSDF();
-  myCStructure->ContextFillArea.Front.Emission        = float (aFront.Emissive());
-
-  // Reflection mode
-  myCStructure->ContextFillArea.Front.IsAmbient    = (aFront.ReflectionMode (Graphic3d_TOR_AMBIENT)  ? 1 : 0);
-  myCStructure->ContextFillArea.Front.IsDiffuse    = (aFront.ReflectionMode (Graphic3d_TOR_DIFFUSE)  ? 1 : 0);
-  myCStructure->ContextFillArea.Front.IsSpecular   = (aFront.ReflectionMode (Graphic3d_TOR_SPECULAR) ? 1 : 0);
-  myCStructure->ContextFillArea.Front.IsEmission   = (aFront.ReflectionMode (Graphic3d_TOR_EMISSION) ? 1 : 0);
-
-  // Materail type
-  //JR/Hp
-  myCStructure->ContextFillArea.Front.IsPhysic     = (aFront.MaterialType (Graphic3d_MATERIAL_PHYSIC) ? 1 : 0);
-
-  // Specular Color
-  myCStructure->ContextFillArea.Front.ColorSpec.r  = float (aFront.SpecularColor().Red());
-  myCStructure->ContextFillArea.Front.ColorSpec.g  = float (aFront.SpecularColor().Green());
-  myCStructure->ContextFillArea.Front.ColorSpec.b  = float (aFront.SpecularColor().Blue());
-
-  // Ambient color
-  myCStructure->ContextFillArea.Front.ColorAmb.r   = float (aFront.AmbientColor().Red());
-  myCStructure->ContextFillArea.Front.ColorAmb.g   = float (aFront.AmbientColor().Green());
-  myCStructure->ContextFillArea.Front.ColorAmb.b   = float (aFront.AmbientColor().Blue());
-
-  // Diffuse color
-  myCStructure->ContextFillArea.Front.ColorDif.r   = float (aFront.DiffuseColor().Red());
-  myCStructure->ContextFillArea.Front.ColorDif.g   = float (aFront.DiffuseColor().Green());
-  myCStructure->ContextFillArea.Front.ColorDif.b   = float (aFront.DiffuseColor().Blue());
-
-  // Emissive color
-  myCStructure->ContextFillArea.Front.ColorEms.r   = float (aFront.EmissiveColor().Red());
-  myCStructure->ContextFillArea.Front.ColorEms.g   = float (aFront.EmissiveColor().Green());
-  myCStructure->ContextFillArea.Front.ColorEms.b   = float (aFront.EmissiveColor().Blue());
-
-  myCStructure->ContextFillArea.Front.EnvReflexion = float (aFront.EnvReflexion());
-
-  myCStructure->ContextFillArea.IsDef = 1; // Definition material ok
-
-  myCStructure->ContextFillArea.Texture.TextureMap   = theAspFill->TextureMap();
-  myCStructure->ContextFillArea.Texture.doTextureMap = theAspFill->TextureMapState() ? 1 : 0;
-  myCStructure->ContextFillArea.ShaderProgram        = theAspFill->ShaderProgram();
-
-  Standard_Integer   aPolyMode;
-  Standard_ShortReal aPolyFactor, aPolyUnits;
-  theAspFill->PolygonOffsets (aPolyMode, aPolyFactor, aPolyUnits);
-  myCStructure->ContextFillArea.PolygonOffsetMode   = aPolyMode;
-  myCStructure->ContextFillArea.PolygonOffsetFactor = aPolyFactor;
-  myCStructure->ContextFillArea.PolygonOffsetUnits  = aPolyUnits;
-
-  myCStructure->UpdateAspects();
-
-  // Attributes are "IsSet" during the first update of context (line, marker...)
-  myCStructure->ContextLine.IsSet     = 1;
-  myCStructure->ContextFillArea.IsSet = 1;
-  myCStructure->ContextMarker.IsSet   = 1;
-  myCStructure->ContextText.IsSet     = 1;
-
-  Update();
-}
-
-//=============================================================================
-//function : SetPrimitivesAspect
-//purpose  :
-//=============================================================================
-void Graphic3d_Structure::SetPrimitivesAspect (const Handle(Graphic3d_AspectText3d)& theAspText)
-{
-  if (IsDeleted()) return;
-
-  Standard_CString         aFont;
-  Standard_Real            aSpace, anExpansion, aTextAngle;
-  Quantity_Color           aColor, aColorSub;
-  Aspect_TypeOfStyleText   aStyle;
-  Aspect_TypeOfDisplayText aDispType;
-  Standard_Boolean         isTextZoomable;
-  Font_FontAspect          aTextFontAspect;
-  theAspText->Values (aColor, aFont, anExpansion, aSpace, aStyle, aDispType, aColorSub, isTextZoomable, aTextAngle, aTextFontAspect);
-
-  myCStructure->ContextText.Color.r         = float (aColor.Red());
-  myCStructure->ContextText.Color.g         = float (aColor.Green());
-  myCStructure->ContextText.Color.b         = float (aColor.Blue());
-  myCStructure->ContextText.Font            = aFont;
-  myCStructure->ContextText.Expan           = float (anExpansion);
-  myCStructure->ContextText.Space           = float (aSpace);
-  myCStructure->ContextText.Style           = aStyle;
-  myCStructure->ContextText.DisplayType     = aDispType;
-  myCStructure->ContextText.ColorSubTitle.r = float (aColorSub.Red());
-  myCStructure->ContextText.ColorSubTitle.g = float (aColorSub.Green());
-  myCStructure->ContextText.ColorSubTitle.b = float (aColorSub.Blue());
-  myCStructure->ContextText.TextZoomable    = isTextZoomable;
-  myCStructure->ContextText.TextAngle       = float (aTextAngle);
-  myCStructure->ContextText.TextFontAspect  = aTextFontAspect;
-  myCStructure->ContextText.ShaderProgram   = theAspText->ShaderProgram();
-
-  myCStructure->ContextText.IsDef = 1;
-
-  myCStructure->UpdateAspects();
-
-  // Attributes are "IsSet" during the first update of a context (line, marker...)
-  myCStructure->ContextLine.IsSet     = 1;
-  myCStructure->ContextFillArea.IsSet = 1;
-  myCStructure->ContextMarker.IsSet   = 1;
-  myCStructure->ContextText.IsSet     = 1;
-
-  Update();
-}
-
-//=============================================================================
-//function : SetPrimitivesAspect
-//purpose  :
-//=============================================================================
-void Graphic3d_Structure::SetPrimitivesAspect (const Handle(Graphic3d_AspectMarker3d)& theAspMarker)
-{
-  if (IsDeleted()) return;
-
-  Standard_Real       aScale;
-  Quantity_Color      aColor;
-  Aspect_TypeOfMarker aMType;
-  theAspMarker->Values (aColor, aMType, aScale);
-
-  myCStructure->ContextMarker.Color.r       = float (aColor.Red());
-  myCStructure->ContextMarker.Color.g       = float (aColor.Green());
-  myCStructure->ContextMarker.Color.b       = float (aColor.Blue());
-  myCStructure->ContextMarker.MarkerType    = aMType;
-  myCStructure->ContextMarker.Scale         = float (aScale);
-  myCStructure->ContextMarker.ShaderProgram = theAspMarker->ShaderProgram();
-  myCStructure->ContextMarker.IsDef         = 1;
-
-  myCStructure->UpdateAspects();
-
-  // Attributes are "IsSet" during the first update of a context (line, marker...)
-  myCStructure->ContextLine.IsSet     = 1;
-  myCStructure->ContextFillArea.IsSet = 1;
-  myCStructure->ContextMarker.IsSet   = 1;
-  myCStructure->ContextText.IsSet     = 1;
-
-  Update();
-}
-
 //=============================================================================
 //function : SetVisual
 //purpose  :
@@ -1997,182 +1465,6 @@ void Graphic3d_Structure::Update (const bool theUpdateLayer) const
                               theUpdateLayer ? myCStructure->ZLayer() : Graphic3d_ZLayerId_UNKNOWN);
 }
 
-//=============================================================================
-//function : UpdateStructure
-//purpose  :
-//=============================================================================
-void Graphic3d_Structure::UpdateStructure (const Handle(Graphic3d_AspectLine3d)&     theAspLine,
-                                           const Handle(Graphic3d_AspectText3d)&     theAspText,
-                                           const Handle(Graphic3d_AspectMarker3d)&   theAspMarker,
-                                           const Handle(Graphic3d_AspectFillArea3d)& theAspFill)
-{
-  Standard_CString          aFont;
-  Standard_Real             aSpace, anExpansion, aWidth, aScale;
-  Quantity_Color            aColor, anIntColor, aBackIntColor, anEdgeColor, aColorSub;
-  Aspect_TypeOfLine         aLType;
-  Aspect_TypeOfMarker       aMType;
-  Aspect_InteriorStyle      aStyle;
-  Aspect_TypeOfStyleText    aStyleT;
-  Aspect_TypeOfDisplayText  aDisplayType;
-  Standard_Boolean          aTextZoomable;
-  Standard_Real             aTextAngle;
-  Font_FontAspect           aTextFontAspect;
-
-  theAspLine->Values (aColor, aLType, aWidth);
-  myCStructure->ContextLine.Color.r        = float (aColor.Red());
-  myCStructure->ContextLine.Color.g        = float (aColor.Green());
-  myCStructure->ContextLine.Color.b        = float (aColor.Blue());
-  myCStructure->ContextLine.LineType       = aLType;
-  myCStructure->ContextLine.Width          = float (aWidth);
-  myCStructure->ContextLine.ShaderProgram  = theAspLine->ShaderProgram();
-
-  theAspMarker->Values (aColor, aMType, aScale);
-  myCStructure->ContextMarker.Color.r      = float (aColor.Red());
-  myCStructure->ContextMarker.Color.g      = float (aColor.Green());
-  myCStructure->ContextMarker.Color.b      = float (aColor.Blue());
-  myCStructure->ContextMarker.MarkerType   = aMType;
-  myCStructure->ContextMarker.Scale        = float (aScale);
-  myCStructure->ContextMarker.ShaderProgram = theAspMarker->ShaderProgram();
-
-  theAspText->Values (aColor, aFont, anExpansion, aSpace, aStyleT, aDisplayType, aColorSub, aTextZoomable, aTextAngle, aTextFontAspect);
-  myCStructure->ContextText.Color.r          = float (aColor.Red());
-  myCStructure->ContextText.Color.g          = float (aColor.Green());
-  myCStructure->ContextText.Color.b          = float (aColor.Blue());
-  myCStructure->ContextText.Font             = aFont;
-  myCStructure->ContextText.Expan            = float (anExpansion);
-  myCStructure->ContextText.Style            = aStyleT;
-  myCStructure->ContextText.DisplayType      = aDisplayType;
-  myCStructure->ContextText.Space            = float (aSpace);
-  myCStructure->ContextText.ColorSubTitle.r  = float (aColorSub.Red());
-  myCStructure->ContextText.ColorSubTitle.g  = float (aColorSub.Green());
-  myCStructure->ContextText.ColorSubTitle.b  = float (aColorSub.Blue());
-  myCStructure->ContextText.TextZoomable     = aTextZoomable;
-  myCStructure->ContextText.TextAngle        = float (aTextAngle);
-  myCStructure->ContextText.TextFontAspect   = aTextFontAspect;
-  myCStructure->ContextText.ShaderProgram    = theAspText->ShaderProgram();
-
-  Standard_Real anRGB[3];
-  theAspFill->Values (aStyle, anIntColor, aBackIntColor, anEdgeColor, aLType, aWidth);
-  anIntColor.Values (anRGB[0], anRGB[1], anRGB[2], Quantity_TOC_RGB);
-  myCStructure->ContextFillArea.Style      = aStyle;
-  myCStructure->ContextFillArea.IntColor.r = float (anRGB[0]);
-  myCStructure->ContextFillArea.IntColor.g = float (anRGB[1]);
-  myCStructure->ContextFillArea.IntColor.b = float (anRGB[2]);
-
-  if (theAspFill->Distinguish())
-  {
-    aBackIntColor.Values (anRGB[0], anRGB[1], anRGB[2], Quantity_TOC_RGB);
-  }
-  myCStructure->ContextFillArea.BackIntColor.r = float (anRGB[0]);
-  myCStructure->ContextFillArea.BackIntColor.g = float (anRGB[1]);
-  myCStructure->ContextFillArea.BackIntColor.b = float (anRGB[2]);
-
-  // Edges
-  myCStructure->ContextFillArea.Edge               = theAspFill->Edge () ? 1:0;
-  myCStructure->ContextFillArea.EdgeColor.r        = float (anEdgeColor.Red());
-  myCStructure->ContextFillArea.EdgeColor.g        = float (anEdgeColor.Green());
-  myCStructure->ContextFillArea.EdgeColor.b        = float (anEdgeColor.Blue());
-  myCStructure->ContextFillArea.LineType           = aLType;
-  myCStructure->ContextFillArea.Width              = float (aWidth);
-  myCStructure->ContextFillArea.Hatch              = theAspFill->HatchStyle();
-
-  // Front and Back face
-  myCStructure->ContextFillArea.Distinguish        = theAspFill->Distinguish() ? 1 : 0;
-  myCStructure->ContextFillArea.BackFace           = theAspFill->BackFace()    ? 1 : 0;
-  // Back Material
-  const Graphic3d_MaterialAspect& aBack = theAspFill->BackMaterial();
-  // Light specificity
-  myCStructure->ContextFillArea.Back.Shininess     = float (aBack.Shininess());
-  myCStructure->ContextFillArea.Back.Ambient       = float (aBack.Ambient());
-  myCStructure->ContextFillArea.Back.Diffuse       = float (aBack.Diffuse());
-  myCStructure->ContextFillArea.Back.Specular      = float (aBack.Specular());
-  myCStructure->ContextFillArea.Back.Transparency  = float (aBack.Transparency());
-  myCStructure->ContextFillArea.Back.Emission      = float (aBack.Emissive());
-
-  // Reflection mode
-  myCStructure->ContextFillArea.Back.IsAmbient     = (aBack.ReflectionMode (Graphic3d_TOR_AMBIENT)  ? 1 : 0);
-  myCStructure->ContextFillArea.Back.IsDiffuse     = (aBack.ReflectionMode (Graphic3d_TOR_DIFFUSE)  ? 1 : 0);
-  myCStructure->ContextFillArea.Back.IsSpecular    = (aBack.ReflectionMode (Graphic3d_TOR_SPECULAR) ? 1 : 0);
-  myCStructure->ContextFillArea.Back.IsEmission    = (aBack.ReflectionMode (Graphic3d_TOR_EMISSION) ? 1 : 0);
-
-  // Material type
-  myCStructure->ContextFillArea.Back.IsPhysic      = (aBack.MaterialType (Graphic3d_MATERIAL_PHYSIC) ? 1 : 0);
-
-  // Specular color
-  myCStructure->ContextFillArea.Back.ColorSpec.r   = float (aBack.SpecularColor().Red());
-  myCStructure->ContextFillArea.Back.ColorSpec.g   = float (aBack.SpecularColor().Green());
-  myCStructure->ContextFillArea.Back.ColorSpec.b   = float (aBack.SpecularColor().Blue());
-
-  // Ambient color
-  myCStructure->ContextFillArea.Back.ColorAmb.r    = float (aBack.AmbientColor().Red());
-  myCStructure->ContextFillArea.Back.ColorAmb.g    = float (aBack.AmbientColor().Green());
-  myCStructure->ContextFillArea.Back.ColorAmb.b    = float (aBack.AmbientColor().Blue());
-
-  // Diffuse color
-  myCStructure->ContextFillArea.Back.ColorDif.r    = float (aBack.DiffuseColor().Red());
-  myCStructure->ContextFillArea.Back.ColorDif.g    = float (aBack.DiffuseColor().Green());
-  myCStructure->ContextFillArea.Back.ColorDif.b    = float (aBack.DiffuseColor().Blue());
-
-  // Emissive color
-  myCStructure->ContextFillArea.Back.ColorEms.r    = float (aBack.EmissiveColor().Red());
-  myCStructure->ContextFillArea.Back.ColorEms.g    = float (aBack.EmissiveColor().Green());
-  myCStructure->ContextFillArea.Back.ColorEms.b    = float (aBack.EmissiveColor().Blue());
-
-  myCStructure->ContextFillArea.Back.EnvReflexion  = float (aBack.EnvReflexion());
-
-  // Front Material
-  const Graphic3d_MaterialAspect& aFront = theAspFill->FrontMaterial();
-  // Light specificity
-  myCStructure->ContextFillArea.Front.Shininess    = float (aFront.Shininess());
-  myCStructure->ContextFillArea.Front.Ambient      = float (aFront.Ambient());
-  myCStructure->ContextFillArea.Front.Diffuse      = float (aFront.Diffuse());
-  myCStructure->ContextFillArea.Front.Specular     = float (aFront.Specular());
-  myCStructure->ContextFillArea.Front.Transparency = float (aFront.Transparency());
-  myCStructure->ContextFillArea.Front.Emission     = float (aFront.Emissive());
-
-  // Reflection mode
-  myCStructure->ContextFillArea.Front.IsAmbient    = (aFront.ReflectionMode (Graphic3d_TOR_AMBIENT)  ? 1 : 0);
-  myCStructure->ContextFillArea.Front.IsDiffuse    = (aFront.ReflectionMode (Graphic3d_TOR_DIFFUSE)  ? 1 : 0);
-  myCStructure->ContextFillArea.Front.IsSpecular   = (aFront.ReflectionMode (Graphic3d_TOR_SPECULAR) ? 1 : 0);
-  myCStructure->ContextFillArea.Front.IsEmission   = (aFront.ReflectionMode (Graphic3d_TOR_EMISSION) ? 1 : 0);
-
-  // Material type
-  myCStructure->ContextFillArea.Front.IsPhysic     = (aFront.MaterialType (Graphic3d_MATERIAL_PHYSIC) ? 1 : 0);
-
-  // Specular color
-  myCStructure->ContextFillArea.Front.ColorSpec.r  = float (aFront.SpecularColor().Red());
-  myCStructure->ContextFillArea.Front.ColorSpec.g  = float (aFront.SpecularColor().Green());
-  myCStructure->ContextFillArea.Front.ColorSpec.b  = float (aFront.SpecularColor().Blue());
-
-  // Ambient color
-  myCStructure->ContextFillArea.Front.ColorAmb.r   = float (aFront.AmbientColor().Red());
-  myCStructure->ContextFillArea.Front.ColorAmb.g   = float (aFront.AmbientColor().Green());
-  myCStructure->ContextFillArea.Front.ColorAmb.b   = float (aFront.AmbientColor().Blue());
-
-  // Diffuse color
-  myCStructure->ContextFillArea.Front.ColorDif.r   = float (aFront.DiffuseColor().Red());
-  myCStructure->ContextFillArea.Front.ColorDif.g   = float (aFront.DiffuseColor().Green());
-  myCStructure->ContextFillArea.Front.ColorDif.b   = float (aFront.DiffuseColor().Blue());
-
-  // Emissive color
-  myCStructure->ContextFillArea.Front.ColorEms.r   = float (aFront.EmissiveColor().Red());
-  myCStructure->ContextFillArea.Front.ColorEms.g   = float (aFront.EmissiveColor().Green());
-  myCStructure->ContextFillArea.Front.ColorEms.b   = float (aFront.EmissiveColor().Blue());
-
-  myCStructure->ContextFillArea.Front.EnvReflexion = float (aFront.EnvReflexion());
-
-  myCStructure->ContextFillArea.Texture.TextureMap   = theAspFill->TextureMap();
-  myCStructure->ContextFillArea.Texture.doTextureMap = theAspFill->TextureMapState() ? 1 : 0;
-  myCStructure->ContextFillArea.ShaderProgram        = theAspFill->ShaderProgram();
-
-  Standard_Integer   aPolyMode;
-  Standard_ShortReal aPolyFactor, aPolyUnits;
-  theAspFill->PolygonOffsets (aPolyMode, aPolyFactor, aPolyUnits);
-  myCStructure->ContextFillArea.PolygonOffsetMode   = aPolyMode;
-  myCStructure->ContextFillArea.PolygonOffsetFactor = aPolyFactor;
-  myCStructure->ContextFillArea.PolygonOffsetUnits  = aPolyUnits;
-}
-
 //=============================================================================
 //function : GraphicHighlight
 //purpose  :
index cdad89fe26aeae109217188de3b254e66e480b8a..aaf328403e06a40e1b7ab8c92591a0cae1e078a1 100644 (file)
@@ -49,10 +49,6 @@ class Graphic3d_TransformError;
 class Graphic3d_Group;
 class Graphic3d_StructureManager;
 class Quantity_Color;
-class Graphic3d_AspectLine3d;
-class Graphic3d_AspectFillArea3d;
-class Graphic3d_AspectText3d;
-class Graphic3d_AspectMarker3d;
 class Graphic3d_DataStructureManager;
 class Bnd_Box;
 class gp_Pnt;
@@ -78,7 +74,6 @@ public:
   
   //! Creates a graphic object in the manager theManager.
   //! It will appear in all the views of the visualiser.
-  //! Warning: The default values AspectLine, AspectFillArea, AspectText and AspectMarker are NOT applied to the structure.
   //! The structure is not displayed when it is created.
   Standard_EXPORT Graphic3d_Structure(const Handle(Graphic3d_StructureManager)& theManager);
   
@@ -172,23 +167,7 @@ public:
   //! Get clip planes slicing the structure on rendering.
   //! @return set of clip planes.
   Standard_EXPORT const Graphic3d_SequenceOfHClipPlane& GetClipPlanes() const;
-  
-  //! Modifies the default attributes for lines
-  //! in the structure <me>.
-  Standard_EXPORT void SetPrimitivesAspect (const Handle(Graphic3d_AspectLine3d)& CTX);
-  
-  //! Modifies the default attributes for faces
-  //! in the structure <me>.
-  Standard_EXPORT void SetPrimitivesAspect (const Handle(Graphic3d_AspectFillArea3d)& CTX);
-  
-  //! Modifies the default attributes for text
-  //! in the structure <me>.
-  Standard_EXPORT void SetPrimitivesAspect (const Handle(Graphic3d_AspectText3d)& CTX);
-  
-  //! Modifies the default attributes for markers
-  //! in the structure <me>.
-  Standard_EXPORT void SetPrimitivesAspect (const Handle(Graphic3d_AspectMarker3d)& CTX);
-  
+
   //! Modifies the visibility indicator to Standard_True or
   //! Standard_False for the structure <me>.
   //! The default value at the definition of <me> is
@@ -241,10 +220,7 @@ public:
   //! Returns Standard_True if the structure <me> contains
   //! Polygons, Triangles or Quadrangles.
   Standard_EXPORT Standard_Boolean ContainsFacet() const;
-  
-  //! Returns the values of the current default attributes.
-  Standard_EXPORT Handle(Graphic3d_AspectFillArea3d) FillArea3dAspect() const;
-  
+
   //! Returns the groups sequence included in the structure <me> (internal storage).
   Standard_EXPORT const Graphic3d_SequenceOfGroup& Groups() const;
   
@@ -285,14 +261,7 @@ public:
   
   //! Returns the visibility indicator for the structure <me>.
   Standard_EXPORT Standard_Boolean IsVisible() const;
-  
-  //! Returns the values of the current default attributes.
-  Standard_EXPORT Handle(Graphic3d_AspectLine3d) Line3dAspect() const;
-  
-  //! Returns the current group of graphic attributes used
-  //! for 3d marker primitives.
-  Standard_EXPORT Handle(Graphic3d_AspectMarker3d) Marker3dAspect() const;
-  
+
   //! Returns the coordinates of the boundary box of the structure <me>.
   //! If <theToIgnoreInfiniteFlag> is TRUE, the method returns actual graphical
   //! boundaries of the Graphic3d_Group components. Otherwise, the
@@ -303,13 +272,7 @@ public:
   //! Warning: If the structure <me> is empty then the empty box is returned,
   //! If the structure <me> is infinite then the whole box is returned.
   Standard_EXPORT Bnd_Box MinMaxValues (const Standard_Boolean theToIgnoreInfiniteFlag = Standard_False) const;
-  
-  //! Returns the current values of the default attributes.
-  Standard_EXPORT void PrimitivesAspect (Handle(Graphic3d_AspectLine3d)& CTXL, Handle(Graphic3d_AspectText3d)& CTXT, Handle(Graphic3d_AspectMarker3d)& CTXM, Handle(Graphic3d_AspectFillArea3d)& CTXF) const;
-  
-  //! Returns the values of the current default attributes.
-  Standard_EXPORT Handle(Graphic3d_AspectText3d) Text3dAspect() const;
-  
+
   //! Returns the visualisation mode for the structure <me>.
   Standard_EXPORT Graphic3d_TypeOfStructure Visual() const;
   
@@ -535,9 +498,8 @@ private:
   //! Calls the Update method of the StructureManager which contains the Structure <me>.
   //! If theUpdateLayer is true then invalidates bounding box of ZLayer.
   Standard_EXPORT void Update (const bool theUpdateLayer = false) const;
-  
-  //! Updates the c structure associated to <me>.
-  Standard_EXPORT void UpdateStructure (const Handle(Graphic3d_AspectLine3d)& CTXL, const Handle(Graphic3d_AspectText3d)& CTXT, const Handle(Graphic3d_AspectMarker3d)& CTXM, const Handle(Graphic3d_AspectFillArea3d)& CTXF);
+
+protected:
 
   Handle(Graphic3d_CStructure) myCStructure;
   Graphic3d_IndexedMapOfAddress myAncestors;
index aa02af4e6a49dc35bf956a7c39c1481b9dd27258..b8bcc6de20845bffed049d27d3738fa7408fe174 100644 (file)
@@ -120,10 +120,6 @@ public:
 // =======================================================================
 OpenGl_Structure::OpenGl_Structure (const Handle(Graphic3d_StructureManager)& theManager)
 : Graphic3d_CStructure (theManager),
-  myAspectLine         (NULL),
-  myAspectFace         (NULL),
-  myAspectMarker       (NULL),
-  myAspectText         (NULL),
   myHighlightColor     (NULL),
   myInstancedStructure (NULL),
   myIsRaytracable      (Standard_False),
@@ -143,25 +139,6 @@ OpenGl_Structure::~OpenGl_Structure()
   Release (Handle(OpenGl_Context)());
 }
 
-// =======================================================================
-// function : UpdateAspects
-// purpose  :
-// =======================================================================
-void OpenGl_Structure::UpdateAspects()
-{
-  if (ContextLine.IsDef)
-    SetAspectLine (ContextLine);
-
-  if (ContextFillArea.IsDef)
-    SetAspectFace (ContextFillArea);
-
-  if (ContextMarker.IsDef)
-    SetAspectMarker (ContextMarker);
-
-  if (ContextText.IsDef)
-    SetAspectText (ContextText);
-}
-
 // =======================================================================
 // function : UpdateTransformation
 // purpose  :
@@ -183,63 +160,6 @@ void OpenGl_Structure::UpdateTransformation()
   }
 }
 
-// =======================================================================
-// function : SetAspectLine
-// purpose  :
-// =======================================================================
-void OpenGl_Structure::SetAspectLine (const CALL_DEF_CONTEXTLINE &theAspect)
-{
-  if (!myAspectLine)
-  {
-    myAspectLine = new OpenGl_AspectLine();
-  }
-  myAspectLine->SetAspect (theAspect);
-}
-
-// =======================================================================
-// function : SetAspectFace
-// purpose  :
-// =======================================================================
-void OpenGl_Structure::SetAspectFace (const CALL_DEF_CONTEXTFILLAREA& theAspect)
-{
-  if (!myAspectFace)
-  {
-    myAspectFace = new OpenGl_AspectFace();
-  }
-  myAspectFace->SetAspect (theAspect);
-
-  if (IsRaytracable())
-  {
-    ++myModificationState;
-  }
-}
-
-// =======================================================================
-// function : SetAspectMarker
-// purpose  :
-// =======================================================================
-void OpenGl_Structure::SetAspectMarker (const CALL_DEF_CONTEXTMARKER& theAspect)
-{
-  if (!myAspectMarker)
-  {
-    myAspectMarker = new OpenGl_AspectMarker();
-  }
-  myAspectMarker->SetAspect (theAspect);
-}
-
-// =======================================================================
-// function : SetAspectText
-// purpose  :
-// =======================================================================
-void OpenGl_Structure::SetAspectText (const CALL_DEF_CONTEXTTEXT &theAspect)
-{
-  if (!myAspectText)
-  {
-    myAspectText = new OpenGl_AspectText();
-  }
-  myAspectText->SetAspect (theAspect);
-}
-
 // =======================================================================
 // function : clearHighlightBox
 // purpose  :
@@ -585,22 +505,6 @@ void OpenGl_Structure::Render (const Handle(OpenGl_Workspace) &theWorkspace) con
   const OpenGl_AspectFace *anAspectFace = theWorkspace->AspectFace (Standard_False);
   const OpenGl_AspectMarker *anAspectMarker = theWorkspace->AspectMarker (Standard_False);
   const OpenGl_AspectText *anAspectText = theWorkspace->AspectText (Standard_False);
-  if (myAspectLine)
-  {
-    theWorkspace->SetAspectLine (myAspectLine);
-  }
-  if (myAspectFace)
-  {
-    theWorkspace->SetAspectFace (myAspectFace);
-  }
-  if (myAspectMarker)
-  {
-    theWorkspace->SetAspectMarker (myAspectMarker);
-  }
-  if (myAspectText)
-  {
-    theWorkspace->SetAspectText (myAspectText);
-  }
 
   // Apply correction for mirror transform
   if (myIsMirrored)
@@ -716,10 +620,6 @@ void OpenGl_Structure::Release (const Handle(OpenGl_Context)& theGlCtx)
 {
   // Release groups
   Clear (theGlCtx);
-  OpenGl_Element::Destroy (theGlCtx.operator->(), myAspectLine);
-  OpenGl_Element::Destroy (theGlCtx.operator->(), myAspectFace);
-  OpenGl_Element::Destroy (theGlCtx.operator->(), myAspectMarker);
-  OpenGl_Element::Destroy (theGlCtx.operator->(), myAspectText);
   clearHighlightColor (theGlCtx);
 }
 
@@ -733,22 +633,6 @@ void OpenGl_Structure::ReleaseGlResources (const Handle(OpenGl_Context)& theGlCt
   {
     aGroupIter.ChangeValue()->Release (theGlCtx);
   }
-  if (myAspectLine != NULL)
-  {
-    myAspectLine->Release (theGlCtx.operator->());
-  }
-  if (myAspectFace != NULL)
-  {
-    myAspectFace->Release (theGlCtx.operator->());
-  }
-  if (myAspectMarker != NULL)
-  {
-    myAspectMarker->Release (theGlCtx.operator->());
-  }
-  if (myAspectText != NULL)
-  {
-    myAspectText->Release (theGlCtx.operator->());
-  }
   if (!myHighlightBox.IsNull())
   {
     myHighlightBox->Release (theGlCtx.operator->());
index 6a4f2157c5fa849d13921b1b7dd4ce37a74177b2..222bfcb11642c4102def094ab80b84d363ecc05c 100644 (file)
@@ -78,9 +78,6 @@ public:
   //! Disconnect other structure to this one
   Standard_EXPORT virtual void Disconnect (Graphic3d_CStructure& theStructure) Standard_OVERRIDE;
 
-  //! Synchronize structure aspects
-  Standard_EXPORT virtual void UpdateAspects() Standard_OVERRIDE;
-
   //! Synchronize structure transformation
   Standard_EXPORT virtual void UpdateTransformation() Standard_OVERRIDE;
 
@@ -115,11 +112,6 @@ public:
     return (OpenGl_GraphicDriver* )myGraphicDriver.operator->();
   }
 
-  void SetAspectLine   (const CALL_DEF_CONTEXTLINE &theAspect);
-  void SetAspectFace   (const CALL_DEF_CONTEXTFILLAREA& theAspect);
-  void SetAspectMarker (const CALL_DEF_CONTEXTMARKER& theAspect);
-  void SetAspectText   (const CALL_DEF_CONTEXTTEXT &theAspect);
-
   void clearHighlightBox (const Handle(OpenGl_Context)& theGlCtx);
 
   void setHighlightColor (const Handle(OpenGl_Context)& theGlCtx,
@@ -185,9 +177,6 @@ public:
   //! Returns instanced OpenGL structure.
   const OpenGl_Structure* InstancedStructure() const { return myInstancedStructure; }
 
-  //! Returns OpenGL face aspect.
-  const OpenGl_AspectFace* AspectFace() const { return myAspectFace; }
-
   //! Returns structure modification state (for ray-tracing).
   Standard_Size ModificationState() const { return myModificationState; }
 
@@ -206,11 +195,6 @@ protected:
 
 protected:
 
-  OpenGl_AspectLine*         myAspectLine;
-  OpenGl_AspectFace*         myAspectFace;
-  OpenGl_AspectMarker*       myAspectMarker;
-  OpenGl_AspectText*         myAspectText;
-
   Handle(OpenGl_Group)       myHighlightBox;
   TEL_COLOUR*                myHighlightColor;
 
index 281b852e66994ece04fe16b8ff346d42c1da6f12..5b2585c985208017ec6640f0c4346eca306df0ea 100644 (file)
@@ -404,21 +404,15 @@ Standard_Boolean OpenGl_View::addRaytraceStructure (const OpenGl_Structure*
   }
 
   // Get structure material
-  OpenGl_RaytraceMaterial aStructMaterial;
-
-  if (theStructure->AspectFace() != NULL)
-  {
-    aStructMaterial = convertMaterial (theStructure->AspectFace(), theGlContext);
-  }
-
-  Standard_Boolean aResult = addRaytraceGroups (theStructure, aStructMaterial, &theStructure->Transformation, theGlContext);
+  OpenGl_RaytraceMaterial aDefaultMaterial;
+  Standard_Boolean aResult = addRaytraceGroups (theStructure, aDefaultMaterial, &theStructure->Transformation, theGlContext);
 
   // Process all connected OpenGL structures
   const OpenGl_Structure* anInstanced = theStructure->InstancedStructure();
 
   if (anInstanced != NULL && anInstanced->IsRaytracable())
   {
-    aResult &= addRaytraceGroups (anInstanced, aStructMaterial, &theStructure->Transformation, theGlContext);
+    aResult &= addRaytraceGroups (anInstanced, aDefaultMaterial, &theStructure->Transformation, theGlContext);
   }
 
   myStructureStates[theStructure] = StructState (theStructure);
index 2fb3c3fc4c721a67c6fe94c6a00afa23df3dd151..a4fda7f84b0bafbec58657bf7f98bdc85e16c20e 100644 (file)
@@ -56,6 +56,7 @@ namespace
   static const OpenGl_AspectLine myDefaultAspectLine;
   static const OpenGl_AspectFace myDefaultAspectFace;
   static const OpenGl_AspectMarker myDefaultAspectMarker;
+  static const OpenGl_AspectText myDefaultAspectText;
 
   static const OpenGl_Matrix myDefaultMatrix =
   {
@@ -153,6 +154,8 @@ OpenGl_Workspace::OpenGl_Workspace (OpenGl_View* theView, const Handle(OpenGl_Wi
   AspectFace_applied (NULL),
   AspectMarker_set (&myDefaultAspectMarker),
   AspectMarker_applied (NULL),
+  AspectText_set   (&myDefaultAspectText),
+  AspectText_applied (NULL),
   ViewMatrix_applied (&myDefaultMatrix),
   StructureMatrix_applied (&myDefaultMatrix),
   myCullingMode (TelCullUndefined),
@@ -245,6 +248,9 @@ void OpenGl_Workspace::ResetAppliedAspect()
   AspectFace_applied    = NULL;
   AspectMarker_set      = &myDefaultAspectMarker;
   AspectMarker_applied  = NULL;
+  AspectText_set        = &myDefaultAspectText;
+  AspectText_applied    = NULL;
+
   PolygonOffset_applied = THE_DEFAULT_POFFSET;
   myCullingMode         = TelCullUndefined;
 
index 1c65b636143bea5dc2ebcd7b5a8c669bf22064f2..b9f79fd7c426a4722ce28e82a18e70713982d2f2 100644 (file)
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-// Modified:     22/03/04 ; SAN : OCC4895 High-level interface for controlling polygon offsets
+#include <Prs3d_Presentation.hxx>
 
-#include <Aspect_InteriorStyle.hxx>
-#include <Aspect_PolygonOffsetMode.hxx>
-#include <Aspect_TypeOfHighlightMethod.hxx>
-#include <Aspect_TypeOfLine.hxx>
 #include <Geom_Transformation.hxx>
 #include <gp_Ax1.hxx>
 #include <gp_Dir.hxx>
 #include <gp_Pnt.hxx>
 #include <gp_Trsf.hxx>
 #include <gp_Vec.hxx>
-#include <Graphic3d_AspectFillArea3d.hxx>
 #include <Graphic3d_DataStructureManager.hxx>
 #include <Graphic3d_Group.hxx>
 #include <Graphic3d_NameOfMaterial.hxx>
 #include <Graphic3d_Structure.hxx>
 #include <Graphic3d_StructureManager.hxx>
-#include <Prs3d_Presentation.hxx>
 #include <Prs3d_Root.hxx>
-#include <Prs3d_ShadingAspect.hxx>
 #include <Standard_Real.hxx>
 #include <Standard_Type.hxx>
 #include <TColStd_Array2OfReal.hxx>
@@ -66,20 +59,6 @@ Prs3d_Presentation::Prs3d_Presentation (const Handle(Graphic3d_StructureManager)
   {
     return;
   }
-
-  Graphic3d_MaterialAspect aMat (Graphic3d_NOM_BRASS);
-  Quantity_Color aColor = aMat.AmbientColor();
-  // It is necessary to set default polygon offsets for a new presentation
-  Handle(Graphic3d_AspectFillArea3d) aDefAspect =
-    new Graphic3d_AspectFillArea3d (Aspect_IS_SOLID,
-                                    aColor,
-                                    aColor,
-                                    Aspect_TOL_SOLID,
-                                    1.0,
-                                    Graphic3d_NOM_BRASS,
-                                    Graphic3d_NOM_BRASS);
-  aDefAspect->SetPolygonOffsets (Aspect_POM_Fill, 1.0f, 0.0f);
-  SetPrimitivesAspect (aDefAspect);
 }
 
 //=======================================================================
@@ -90,28 +69,7 @@ Prs3d_Presentation::Prs3d_Presentation (const Handle(Graphic3d_StructureManager)
                                         const Handle(Prs3d_Presentation)&         thePrs)
 : Graphic3d_Structure (theViewer, thePrs)
 {
-  Graphic3d_MaterialAspect aMat (Graphic3d_NOM_BRASS);
-  Quantity_Color aColor = aMat.AmbientColor();
-  // It is necessary to set default polygon offsets for a new presentation
-  Handle(Graphic3d_AspectFillArea3d) aDefAspect =
-    new Graphic3d_AspectFillArea3d (Aspect_IS_SOLID,
-                                    aColor,
-                                    aColor,
-                                    Aspect_TOL_SOLID,
-                                    1.0,
-                                    Graphic3d_NOM_BRASS,
-                                    Graphic3d_NOM_BRASS);
-  aDefAspect->SetPolygonOffsets (Aspect_POM_Fill, 1.0f, 0.0f);
-  SetPrimitivesAspect (aDefAspect);
-}
-
-//=======================================================================
-//function : SetShadingAspect
-//purpose  : 
-//=======================================================================
-void Prs3d_Presentation::SetShadingAspect(const Handle(Prs3d_ShadingAspect)& aShadingAspect) 
-{ 
-  SetPrimitivesAspect(aShadingAspect->Aspect());
+  //
 }
 
 //=======================================================================
index e195177fed7178bc83ce884382c749ba2a42d0ab..ba12c7a59d92ba39cf18e03cd78f8d911caba202 100644 (file)
@@ -28,7 +28,6 @@ class Prs3d_Root;
 class Graphic3d_StructureManager;
 class Graphic3d_Structure;
 class Graphic3d_DataStructureManager;
-class Prs3d_ShadingAspect;
 class Geom_Transformation;
 class Graphic3d_Group;
 
@@ -68,9 +67,7 @@ public:
   
   //! Returns the new Structure defined for the new visualization
   Standard_EXPORT virtual void Compute (const Handle(Graphic3d_DataStructureManager)& aProjector, const TColStd_Array2OfReal& AMatrix, Handle(Graphic3d_Structure)& aStructure) Standard_OVERRIDE;
-  
-  Standard_EXPORT void SetShadingAspect (const Handle(Prs3d_ShadingAspect)& aShadingAspect);
-  
+
   Standard_EXPORT void Transform (const Handle(Geom_Transformation)& aTransformation);
   
   Standard_EXPORT void Place (const Quantity_Length X, const Quantity_Length Y, const Quantity_Length Z);
index 75f46a5cdbe54c91ca29d280f79bb07aff6bb7e6..bef70f226830f18acbf99033b77c80594d447702 100644 (file)
@@ -12,6 +12,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
+#include <PrsMgr_Presentation.hxx>
 
 #include <Geom_Transformation.hxx>
 #include <Graphic3d_DataStructureManager.hxx>
 #include <Precision.hxx>
 #include <Prs3d_Presentation.hxx>
 #include <Prs3d_Projector.hxx>
-#include <Prs3d_ShadingAspect.hxx>
 #include <PrsMgr_ModedPresentation.hxx>
 #include <PrsMgr_PresentableObject.hxx>
-#include <PrsMgr_Presentation.hxx>
 #include <PrsMgr_PresentationManager.hxx>
 #include <PrsMgr_Prs.hxx>
 #include <Quantity_Color.hxx>
@@ -266,15 +265,6 @@ void PrsMgr_Presentation::Move (const Quantity_Length theX,
   myStructure->Move (theX, theY, theZ);
 }
 
-//=======================================================================
-//function : SetShadingAspect
-//purpose  :
-//=======================================================================
-void PrsMgr_Presentation::SetShadingAspect (const Handle(Prs3d_ShadingAspect)& theShadingAspect) const
-{
-  myStructure->SetShadingAspect (theShadingAspect);
-}
-
 //=======================================================================
 //function : Compute
 //purpose  : Methods for hidden parts...
index fd2879d058e0aec04dea02e8f915182a92d783f3..7977ea73825ea09dce24167dd07d07c78c91d24a 100644 (file)
@@ -31,7 +31,6 @@ class PrsMgr_Prs;
 class PrsMgr_PresentableObject;
 class Quantity_Color;
 class Geom_Transformation;
-class Prs3d_ShadingAspect;
 class Prs3d_Presentation;
 class Graphic3d_Structure;
 class Graphic3d_DataStructureManager;
@@ -117,9 +116,7 @@ private:
   Standard_EXPORT void Multiply (const Handle(Geom_Transformation)& theTrsf) const;
   
   Standard_EXPORT void Move (const Quantity_Length theX, const Quantity_Length theY, const Quantity_Length theZ) const;
-  
-  Standard_EXPORT void SetShadingAspect (const Handle(Prs3d_ShadingAspect)& theShadingAspect) const;
-  
+
   Standard_EXPORT void Compute (const Handle(Graphic3d_Structure)& theStructure);
   
   Standard_EXPORT Handle(Graphic3d_Structure) Compute (const Handle(Graphic3d_DataStructureManager)& theProjector);
@@ -132,6 +129,8 @@ private:
   
   Standard_EXPORT static Handle(Prs3d_Projector) Projector (const Handle(Graphic3d_DataStructureManager)& theProjector);
 
+protected:
+
   Handle(PrsMgr_PresentationManager) myPresentationManager;
   Handle(Prs3d_Presentation) myStructure;
   PrsMgr_PresentableObjectPointer myPresentableObject;
index 65b313cb169df27c90cc33a077e1590435cf1637..234049e48278101b1fbcbefaa130db31cd7e9793 100644 (file)
@@ -17,7 +17,6 @@
 #include <Graphic3d_GraphicDriver.hxx>
 #include <Prs3d_Presentation.hxx>
 #include <Prs3d_PresentationShadow.hxx>
-#include <Prs3d_ShadingAspect.hxx>
 #include <PrsMgr_ModedPresentation.hxx>
 #include <PrsMgr_PresentableObject.hxx>
 #include <PrsMgr_Presentation.hxx>
@@ -641,36 +640,6 @@ void PrsMgr_PresentationManager::BoundBox (const Handle(PrsMgr_PresentableObject
   aPrs->Highlight (Aspect_TOHM_BOUNDBOX, mySelectionColor);
 }
 
-// =======================================================================
-// function : SetShadingAspect
-// purpose  :
-// =======================================================================
-void PrsMgr_PresentationManager::SetShadingAspect (const Handle(PrsMgr_PresentableObject)& thePrsObject,
-                                                   const Quantity_NameOfColor              theColor,
-                                                   const Graphic3d_NameOfMaterial          theMaterial,
-                                                   const Standard_Integer                  theMode)
-{
-  Handle(Prs3d_ShadingAspect) anAspect = new Prs3d_ShadingAspect();
-  anAspect->SetColor    (theColor);
-  anAspect->SetMaterial (theMaterial);
-  SetShadingAspect (thePrsObject, anAspect, theMode);
-}
-
-// =======================================================================
-// function : SetShadingAspect
-// purpose  :
-// =======================================================================
-void PrsMgr_PresentationManager::SetShadingAspect (const Handle(PrsMgr_PresentableObject)& thePrsObj,
-                                                   const Handle(Prs3d_ShadingAspect)&      theShadingAspect,
-                                                   const Standard_Integer                  theMode)
-{
-  const Handle(PrsMgr_Presentation) aPrs = Presentation (thePrsObj, theMode);
-  if (!aPrs.IsNull())
-  {
-    aPrs->SetShadingAspect (theShadingAspect);
-  }
-}
-
 namespace
 {
   // =======================================================================
index 0372de16787ac132d173298c40918031950b48d1..7f612190bd3a7a1040a07af89b6d720dd353e721 100644 (file)
@@ -31,7 +31,6 @@
 
 class Geom_Transformation;
 class Prs3d_Presentation;
-class Prs3d_ShadingAspect;
 class PrsMgr_PresentableObject;
 class PrsMgr_Presentation;
 class Standard_NoSuchObject;
@@ -145,14 +144,8 @@ public:
   Standard_EXPORT void Transform (const Handle(PrsMgr_PresentableObject)& thePrsObject, const Handle(Geom_Transformation)& theTransformation, const Standard_Integer theMode = 0);
   
   //! Returns the structure manager.
-    const Handle(Graphic3d_StructureManager)& StructureManager() const;
-  
-  //! this method will change the color and the aspect of the presentations containing shaded structures.
-  Standard_EXPORT void SetShadingAspect (const Handle(PrsMgr_PresentableObject)& thePrsObject, const Quantity_NameOfColor theColor, const Graphic3d_NameOfMaterial theMaterial, const Standard_Integer theMode = 0);
-  
-  //! this method will change the color and the aspect of the presentations containing shaded structures.
-  Standard_EXPORT void SetShadingAspect (const Handle(PrsMgr_PresentableObject)& thePrsObject, const Handle(Prs3d_ShadingAspect)& theShadingAspect, const Standard_Integer theMode = 0);
-  
+  const Handle(Graphic3d_StructureManager)& StructureManager() const;
+
   //! Returns true if there is a presentation of the
   //! presentable object thePrsObject in this framework, thePrsObject having the display mode theMode.
   Standard_EXPORT Standard_Boolean HasPresentation (const Handle(PrsMgr_PresentableObject)& thePrsObject, const Standard_Integer theMode = 0) const;
index 8e385ff301b45768d882cfff77ba6c89a2d11de5..baf29aa027bf1f1a76ce66e04f043a22cdd67fe0 100644 (file)
@@ -232,109 +232,3 @@ void V3d::SwitchViewsinWindow(const Handle(V3d_View)& aPreviousView,
   aNextView->Viewer()->SetViewOn(aNextView);
     
 }
-void V3d::DrawSphere(const Handle(V3d_Viewer)& aViewer,const Quantity_Length ray)
-{
-  const Standard_Boolean inf = ray < 0;
-  const Standard_Real aRadius = Standard_ShortReal(Abs(ray));
-  Handle(Graphic3d_Structure) Struct = new Graphic3d_Structure(aViewer->StructureManager());
-  Handle(Graphic3d_Group)     Group  = Struct->NewGroup();
-
-  Handle(Graphic3d_AspectLine3d) LineAttrib = new Graphic3d_AspectLine3d() ;
-  LineAttrib->SetColor(Quantity_Color(Quantity_NOC_YELLOW));
-  Struct->SetPrimitivesAspect(LineAttrib) ;
-
-  const Standard_Integer NFACES = 30;
-  Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(NFACES*(NFACES+1),NFACES);
-
-  const Standard_Real Dbeta = 2. * M_PI / NFACES;
-  const Standard_Real Dalpha = 2. * M_PI / NFACES;
-  Standard_ShortReal X,Y,Z,X0 = 0.,Y0 = 0.,Z0 = 0.;
-  Standard_Real R, Alpha, Beta = 0.;
-  Standard_Integer i,j ;
-  for( j=0; j<NFACES/2 ; j++, Beta += Dbeta ) {
-    aPrims->AddBound(NFACES+1);
-    R = aRadius*sin(Beta);
-    Z = Standard_ShortReal(aRadius*cos(Beta));
-    for( i=0, Alpha = 0.; i<NFACES; i++, Alpha += Dalpha ) {
-      X = Standard_ShortReal(R*cos(Alpha));
-      Y = Standard_ShortReal(R*sin(Alpha));
-      aPrims->AddVertex(X,Y,Z);
-      if (i==0) { X0=X, Y0=Y, Z0=Z; }
-    }
-    aPrims->AddVertex(X0,Y0,Z0);
-  }
-  for( j=0; j<NFACES/2 ; j++, Beta += Dbeta ) {
-    aPrims->AddBound(NFACES+1);
-    R = aRadius*sin(Beta);
-    Y = Standard_ShortReal(aRadius*cos(Beta));
-    Beta += Dbeta ;
-    for( i=0, Alpha = 0.; i<NFACES; i++, Alpha += Dalpha ) {
-      X = Standard_ShortReal(R*cos(Alpha));
-      Z = Standard_ShortReal(R*sin(Alpha));
-      aPrims->AddVertex(X,Y,Z);
-      if (i==0) { X0=X, Y0=Y, Z0=Z; }
-    }
-    aPrims->AddVertex(X0,Y0,Z0);
-  }
-  Group->AddPrimitiveArray(aPrims);
-  if(inf) Struct->SetInfiniteState(Standard_True);
-  Struct->Display();
-  aViewer->Update();
-}
-
-void V3d::SetPlane(const Handle(V3d_Viewer)& aViewer, 
-                   const Standard_Real x1,
-                   const Standard_Real y1,
-                   const Standard_Real z1,
-                   const Standard_Real x2,
-                   const Standard_Real y2,
-                   const Standard_Real z2) {
-
-  gp_Ax3 a(gp_Pnt(0.,0.,0),gp_Dir(x1,y1,z1),gp_Dir(x2,y2,z2));
-  aViewer->SetPrivilegedPlane(a);
-
-}
-void V3d::PickGrid(const Handle(V3d_Viewer)& aViewer,
-//                                const Quantity_Length ray) {
-                                const Quantity_Length ) {
-Standard_Real x1, y1, z1;
-Standard_Real x2, y2, z2;
-        cout << "Direction ? " << flush;
-        cin >> x1; cin >> y1; cin >> z1;
-        cout << "XDirection ? " << flush;
-        cin >> x2; cin >> y2; cin >> z2;
-Standard_Integer u, v;
-        cout << "u, v ? " << flush;
-        cin >> u; cin >> v;
-        V3d::SetPlane (aViewer, x1, y1, z1, x2, y2, z2);
-
-        // To restart the calculation on the new plane
-        if (aViewer->Grid ()->IsActive ()) {
-                Standard_Real xo, yo;
-                Quantity_PlaneAngle angle;
-                switch (aViewer->GridType ()) {
-                        case Aspect_GT_Rectangular :
-                                Standard_Real xstep, ystep;
-                                aViewer->RectangularGridValues
-                                        (xo, yo, xstep, ystep, angle);
-                                aViewer->SetRectangularGridValues
-                                        (xo, yo, xstep, ystep, angle);
-                        break;
-                        case Aspect_GT_Circular :
-                                Standard_Real radiusstep;
-                                Standard_Integer division;
-                                aViewer->CircularGridValues
-                                        (xo, yo, radiusstep, division, angle);
-                                aViewer->SetCircularGridValues
-                                        (xo, yo, radiusstep, division, angle);
-                        break;
-                }
-        }
-
-        for (aViewer->InitActiveViews ();
-                aViewer->MoreActiveViews ();
-                   aViewer->NextActiveViews()) {
-Standard_Real X, Y, Z;
-                aViewer->ActiveView ()->Convert (u, v, X, Y, Z);
-        }
-}
index 503b485b3ca76f5d88927c1c2189548c0d6d4197..0ab00887c269da425789b191f8f0e18011b755f0 100644 (file)
@@ -72,29 +72,6 @@ public:
   Standard_EXPORT static void CircleInPlane (const Handle(Graphic3d_Group)& gcircle, const V3d_Coordinate X0, const V3d_Coordinate Y0, const V3d_Coordinate Z0, const V3d_Parameter VX, const V3d_Parameter VY, const V3d_Parameter VZ, const V3d_Parameter Radius);
   
   Standard_EXPORT static void SwitchViewsinWindow (const Handle(V3d_View)& aPreviousView, const Handle(V3d_View)& aNextView);
-  
-  //! test.
-  Standard_EXPORT static void DrawSphere (const Handle(V3d_Viewer)& aViewer, const Quantity_Length aRadius = 1000);
-  
-  //! test.
-  Standard_EXPORT static void PickGrid (const Handle(V3d_Viewer)& aViewer, const Quantity_Length aRadius = 1000);
-  
-  //! test.
-  Standard_EXPORT static void SetPlane (const Handle(V3d_Viewer)& aViewer, const Quantity_Length x1, const Quantity_Length y1, const Quantity_Length z1, const Quantity_Length x2, const Quantity_Length y2, const Quantity_Length z2);
-
-
-
-
-protected:
-
-
-
-
-
-private:
-
-
-
 
 friend class V3d_Viewer;
 friend class V3d_View;
index d6b6b8499cea2653a5b9696f19143b65aa0008d6..09b71c1e96a2f0cc9b42d08eaa2b769c0e698031 100755 (executable)
@@ -72,7 +72,7 @@ void V3d_Plane::Display (const Handle(V3d_View)& theView,
   anAsp->SetFrontMaterial (aPlastic);
   anAsp->SetInteriorStyle (Aspect_IS_HATCH);
   anAsp->SetHatchStyle (Aspect_HS_GRID_DIAGONAL_WIDE);
-  myGraphicStructure->SetPrimitivesAspect (anAsp);
+  aGroup->SetGroupPrimitivesAspect (anAsp);
 
   const Standard_ShortReal aSize = (Standard_ShortReal)(0.5*aViewer->DefaultViewSize());
   const Standard_ShortReal anOffset = aSize/5000.0f;
index a3cefaf0894025c15bcbf84cff15ec6c7be2a907..0aeef7175753877ad64c2ac10b0c7f5591ee198f 100644 (file)
@@ -3562,6 +3562,8 @@ void MyPArrayObject::Compute (const Handle(PrsMgr_PresentationManager3d)& /*aPre
   {
     Prs3d_Root::CurrentGroup (aPresentation)->SetGroupPrimitivesAspect (myMarkerAspect);
   }
+  Prs3d_Root::CurrentGroup (aPresentation)->SetGroupPrimitivesAspect (myDrawer->LineAspect()->Aspect());
+  Prs3d_Root::CurrentGroup (aPresentation)->SetGroupPrimitivesAspect (myDrawer->ShadingAspect()->Aspect());
   Prs3d_Root::CurrentGroup (aPresentation)->AddPrimitiveArray (anArray);
 }
 
index 83ddf50767805a22bb6a48cd58a95888a3e6bce8..dca94bf4c88025c7e2a0354d0c921be805a6acdc 100644 (file)
@@ -36,6 +36,7 @@
 #include <Prs3d_Drawer.hxx>
 #include <Prs3d_Presentation.hxx>
 #include <Prs3d_Root.hxx>
+#include <Prs3d_LineAspect.hxx>
 #include <Prs3d_ShadingAspect.hxx>
 #include <Select3D_SensitiveCurve.hxx>
 #include <SelectMgr_EntityOwner.hxx>
@@ -129,6 +130,7 @@ void VUserDrawObj::Compute(const Handle(PrsMgr_PresentationManager3d)& thePrsMgr
   Handle(OpenGl_Group) aGroup = Handle(OpenGl_Group)::DownCast (thePrs->NewGroup());
   aGroup->SetMinMaxValues (aBndMin.x(), aBndMin.y(), aBndMin.z(),
                            aBndMax.x(), aBndMax.y(), aBndMax.z());
+  aGroup->SetGroupPrimitivesAspect (myDrawer->LineAspect()->Aspect());
   VUserDrawObj::Element* anElem = new VUserDrawObj::Element (this);
   aGroup->AddElement(anElem);