1 // Created on: 2003-09-09
2 // Created by: Alexander SOLOVYOV
3 // Copyright (c) 2003-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #include <MeshVS_PrsBuilder.ixx>
18 #include <Prs3d_Root.hxx>
19 #include <MeshVS_Mesh.hxx>
21 //================================================================
22 // Function : Constructor MeshVS_PrsBuilder
24 //================================================================
25 MeshVS_PrsBuilder::MeshVS_PrsBuilder ( const Handle(MeshVS_Mesh)& Parent,
26 const MeshVS_DisplayModeFlags& Flags,
27 const Handle(MeshVS_DataSource)& DS,
28 const Standard_Integer Id,
29 const MeshVS_BuilderPriority& Priority )
31 if (Id<0 && Parent!=0 )
32 myId = Parent->GetFreeId();
36 myParentMesh = Parent.operator->();
41 myIsExcluding = Standard_False;
43 myPriority = Priority;
46 //================================================================
47 // Function : CustomDraw
49 //================================================================
50 void MeshVS_PrsBuilder::CustomBuild ( const Handle(Prs3d_Presentation)&,
51 const TColStd_PackedMapOfInteger&,
52 TColStd_PackedMapOfInteger&,
53 const Standard_Integer ) const
57 //================================================================
58 // Function : CustomSensitiveEntity
60 //================================================================
61 Handle( SelectBasics_SensitiveEntity ) MeshVS_PrsBuilder::CustomSensitiveEntity
62 ( const Handle( SelectBasics_EntityOwner )&,
63 const Standard_Integer ) const
68 //================================================================
69 // Function : DataSource
71 //================================================================
72 Handle (MeshVS_DataSource) MeshVS_PrsBuilder::DataSource () const
77 //================================================================
78 // Function : GetDataSource
80 //================================================================
81 Handle (MeshVS_DataSource) MeshVS_PrsBuilder::GetDataSource () const
83 if ( myDataSource.IsNull() )
84 return myParentMesh->GetDataSource();
89 //================================================================
90 // Function : SetDataSource
92 //================================================================
93 void MeshVS_PrsBuilder::SetDataSource ( const Handle (MeshVS_DataSource)& DS )
98 //================================================================
99 // Function : GetFlags
101 //================================================================
102 Standard_Integer MeshVS_PrsBuilder::GetFlags () const
107 //================================================================
110 //================================================================
111 Standard_Integer MeshVS_PrsBuilder::GetId () const
116 //================================================================
117 // Function : TestFlags
119 //================================================================
120 Standard_Boolean MeshVS_PrsBuilder::TestFlags ( const Standard_Integer DisplayMode ) const
122 return ( ( DisplayMode & GetFlags() ) > 0 );
125 //================================================================
126 // Function : SetExcluding
128 //================================================================
129 void MeshVS_PrsBuilder::SetExcluding ( const Standard_Boolean state )
131 myIsExcluding = state;
134 //================================================================
135 // Function : IsExcludingOn
137 //================================================================
138 Standard_Boolean MeshVS_PrsBuilder::IsExcludingOn () const
140 return myIsExcluding;
143 //================================================================
144 // Function : GetPriority
146 //================================================================
147 Standard_Integer MeshVS_PrsBuilder::GetPriority () const
152 //================================================================
153 // Function : GetDrawer
155 //================================================================
156 Handle (MeshVS_Drawer) MeshVS_PrsBuilder::GetDrawer () const
158 if ( myDrawer.IsNull() )
159 return myParentMesh->GetDrawer();
164 //================================================================
165 // Function : SetDataSource
167 //================================================================
168 void MeshVS_PrsBuilder::SetDrawer ( const Handle (MeshVS_Drawer)& Dr )
173 //================================================================
176 //================================================================
177 Handle (MeshVS_Drawer) MeshVS_PrsBuilder::Drawer () const
182 //================================================================
183 // Function : SetPresentationManager
184 // Purpose : Set presentation manager. This method is used by
185 // MeshVS_Mesh::Compute methodto assign presentation
186 // manager to the builder.
187 //================================================================
188 void MeshVS_PrsBuilder::SetPresentationManager( const Handle(PrsMgr_PresentationManager3d)& thePrsMgr )
190 myPrsMgr = thePrsMgr;
193 //================================================================
194 // Function : GetPresentationManager
195 // Purpose : Get presentation manager
196 //================================================================
197 Handle(PrsMgr_PresentationManager3d) MeshVS_PrsBuilder::GetPresentationManager() const