1 // Copyright (c) 1995-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
15 #include <Prs3d_Presentation.hxx>
17 #include <Geom_Transformation.hxx>
21 #include <gp_Trsf.hxx>
23 #include <Graphic3d_DataStructureManager.hxx>
24 #include <Graphic3d_Group.hxx>
25 #include <Graphic3d_NameOfMaterial.hxx>
26 #include <Graphic3d_Structure.hxx>
27 #include <Graphic3d_StructureManager.hxx>
28 #include <Prs3d_Root.hxx>
29 #include <Standard_Real.hxx>
30 #include <Standard_Type.hxx>
32 IMPLEMENT_STANDARD_RTTIEXT(Prs3d_Presentation,Graphic3d_Structure)
34 //=======================================================================
35 //function : Prs3d_Presentation
37 //=======================================================================
38 Prs3d_Presentation::Prs3d_Presentation (const Handle(Graphic3d_StructureManager)& theViewer,
39 const Standard_Boolean theToInit)
40 : Graphic3d_Structure (theViewer)
48 //=======================================================================
49 //function : Prs3d_Presentation
51 //=======================================================================
52 Prs3d_Presentation::Prs3d_Presentation (const Handle(Graphic3d_StructureManager)& theViewer,
53 const Handle(Prs3d_Presentation)& thePrs)
54 : Graphic3d_Structure (theViewer, thePrs)
60 //=======================================================================
63 //=======================================================================
64 void Prs3d_Presentation::Connect
65 ( const Handle(Prs3d_Presentation)& aPresentation)
67 Graphic3d_Structure::Connect(aPresentation, Graphic3d_TOC_DESCENDANT);
71 //=======================================================================
74 //=======================================================================
75 void Prs3d_Presentation::Remove (const Handle(Prs3d_Presentation)& aPresentation)
77 Disconnect(aPresentation);
80 //=======================================================================
81 //function : RemoveAll
83 //=======================================================================
84 void Prs3d_Presentation::RemoveAll ()
86 DisconnectAll(Graphic3d_TOC_DESCENDANT);
90 //=======================================================================
91 //function : CurrentGroup
93 //=======================================================================
94 Handle(Graphic3d_Group) Prs3d_Presentation::CurrentGroup () const
96 if (Groups().IsEmpty())
98 return const_cast<Prs3d_Presentation* >(this)->NewGroup();
100 return Groups().Last();
103 //=======================================================================
106 //=======================================================================
108 Handle(Graphic3d_Structure) Prs3d_Presentation::
109 Compute(const Handle(Graphic3d_DataStructureManager)& /*aProjector*/)
114 //=======================================================================
117 //=======================================================================
119 void Prs3d_Presentation::Compute(const Handle(Graphic3d_DataStructureManager)& aDataStruct,
120 Handle(Graphic3d_Structure)& aStruct)
122 Graphic3d_Structure::Compute(aDataStruct,aStruct );
125 //=======================================================================
128 //=======================================================================
130 Handle(Graphic3d_Structure) Prs3d_Presentation::Compute (const Handle(Graphic3d_DataStructureManager)& theDataStruc,
131 const Handle(Geom_Transformation)& theTrsf)
133 return Graphic3d_Structure::Compute (theDataStruc, theTrsf);
136 //=======================================================================
139 //=======================================================================
141 void Prs3d_Presentation::Compute (const Handle(Graphic3d_DataStructureManager)& theDataStruc,
142 const Handle(Geom_Transformation)& theTrsf,
143 Handle(Graphic3d_Structure)& theStruc)
145 Graphic3d_Structure::Compute (theDataStruc, theTrsf, theStruc);