1 // Created on: 2003-09-09
2 // Created by: Alexander SOLOVYOV
3 // Copyright (c) 2003-2012 OPEN CASCADE SAS
5 // The content of this file is subject to the Open CASCADE Technology Public
6 // License Version 6.5 (the "License"). You may not use the content of this file
7 // except in compliance with the License. Please obtain a copy of the License
8 // at http://www.opencascade.org and read it completely before using this file.
10 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 // The Original Code and all software distributed under the License is
14 // distributed on an "AS IS" basis, without warranty of any kind, and the
15 // Initial Developer hereby disclaims all such warranties, including without
16 // limitation, any warranties of merchantability, fitness for a particular
17 // purpose or non-infringement. Please see the License for the specific terms
18 // and conditions governing the rights and limitations under the License.
21 #include <MeshVS_PrsBuilder.ixx>
23 #include <Prs3d_Root.hxx>
24 #include <MeshVS_Mesh.hxx>
26 //================================================================
27 // Function : Constructor MeshVS_PrsBuilder
29 //================================================================
30 MeshVS_PrsBuilder::MeshVS_PrsBuilder ( const Handle(MeshVS_Mesh)& Parent,
31 const MeshVS_DisplayModeFlags& Flags,
32 const Handle(MeshVS_DataSource)& DS,
33 const Standard_Integer Id,
34 const MeshVS_BuilderPriority& Priority )
36 if (Id<0 && Parent!=0 )
37 myId = Parent->GetFreeId();
41 myParentMesh = Parent.operator->();
46 myIsExcluding = Standard_False;
48 myPriority = Priority;
51 //================================================================
52 // Function : CustomDraw
54 //================================================================
55 void MeshVS_PrsBuilder::CustomBuild ( const Handle(Prs3d_Presentation)&,
56 const TColStd_PackedMapOfInteger&,
57 TColStd_PackedMapOfInteger&,
58 const Standard_Integer ) const
62 //================================================================
63 // Function : CustomSensitiveEntity
65 //================================================================
66 Handle( SelectBasics_SensitiveEntity ) MeshVS_PrsBuilder::CustomSensitiveEntity
67 ( const Handle( SelectBasics_EntityOwner )&,
68 const Standard_Integer ) const
73 //================================================================
74 // Function : DataSource
76 //================================================================
77 Handle (MeshVS_DataSource) MeshVS_PrsBuilder::DataSource () const
82 //================================================================
83 // Function : GetDataSource
85 //================================================================
86 Handle (MeshVS_DataSource) MeshVS_PrsBuilder::GetDataSource () const
88 if ( myDataSource.IsNull() )
89 return myParentMesh->GetDataSource();
94 //================================================================
95 // Function : SetDataSource
97 //================================================================
98 void MeshVS_PrsBuilder::SetDataSource ( const Handle (MeshVS_DataSource)& DS )
103 //================================================================
104 // Function : GetFlags
106 //================================================================
107 Standard_Integer MeshVS_PrsBuilder::GetFlags () const
112 //================================================================
115 //================================================================
116 Standard_Integer MeshVS_PrsBuilder::GetId () const
121 //================================================================
122 // Function : TestFlags
124 //================================================================
125 Standard_Boolean MeshVS_PrsBuilder::TestFlags ( const Standard_Integer DisplayMode ) const
127 return ( ( DisplayMode & GetFlags() ) > 0 );
130 //================================================================
131 // Function : SetExcluding
133 //================================================================
134 void MeshVS_PrsBuilder::SetExcluding ( const Standard_Boolean state )
136 myIsExcluding = state;
139 //================================================================
140 // Function : IsExcludingOn
142 //================================================================
143 Standard_Boolean MeshVS_PrsBuilder::IsExcludingOn () const
145 return myIsExcluding;
148 //================================================================
149 // Function : GetPriority
151 //================================================================
152 Standard_Integer MeshVS_PrsBuilder::GetPriority () const
157 //================================================================
158 // Function : GetDrawer
160 //================================================================
161 Handle (MeshVS_Drawer) MeshVS_PrsBuilder::GetDrawer () const
163 if ( myDrawer.IsNull() )
164 return myParentMesh->GetDrawer();
169 //================================================================
170 // Function : SetDataSource
172 //================================================================
173 void MeshVS_PrsBuilder::SetDrawer ( const Handle (MeshVS_Drawer)& Dr )
178 //================================================================
181 //================================================================
182 Handle (MeshVS_Drawer) MeshVS_PrsBuilder::Drawer () const
187 //================================================================
188 // Function : SetPresentationManager
189 // Purpose : Set presentation manager. This method is used by
190 // MeshVS_Mesh::Compute methodto assign presentation
191 // manager to the builder.
192 //================================================================
193 void MeshVS_PrsBuilder::SetPresentationManager( const Handle(PrsMgr_PresentationManager3d)& thePrsMgr )
195 myPrsMgr = thePrsMgr;
198 //================================================================
199 // Function : GetPresentationManager
200 // Purpose : Get presentation manager
201 //================================================================
202 Handle(PrsMgr_PresentationManager3d) MeshVS_PrsBuilder::GetPresentationManager() const