]> SALOME platform Git repositories - modules/geom.git/blob - src/OBJECT/GEOM_TopWireframeShape.cxx
Salome HOME
Copyrights update 2015.
[modules/geom.git] / src / OBJECT / GEOM_TopWireframeShape.cxx
1 // Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 //  GEOM OBJECT : interactive object for Geometry entities visualization
24 //  File   : GEOM_TopWireframeShape.cxx
25 //  Author : 
26 //  Module : GEOM
27
28 /*!
29   \class GEOM_TopWireframeShape GEOM_TopWireframeShape.hxx
30   \brief This class designed for drawing special OCC wireframe
31          presentation on the top level of the viewer.         
32 */
33
34 //Local includes
35 #include "GEOM_TopWireframeShape.hxx"
36 #include "GEOM_AISShape.hxx"
37
38 //GUI includes
39 #include <SALOME_InteractiveObject.hxx>
40
41 //Open CASCADE includes
42 #include <AIS_Drawer.hxx>
43 #include <TopoDS_Shape.hxx>
44 #include <Prs3d_IsoAspect.hxx>
45
46 IMPLEMENT_STANDARD_HANDLE(GEOM_TopWireframeShape, SALOME_AISShape)
47 IMPLEMENT_STANDARD_RTTIEXT(GEOM_TopWireframeShape, SALOME_AISShape)
48
49 GEOM_TopWireframeShape::GEOM_TopWireframeShape( const TopoDS_Shape& shape )
50   :SALOME_AISShape(shape)
51 {
52   SetDisplayMode( AIS_WireFrame );
53   Handle(Prs3d_IsoAspect) anAspect = Attributes()->UIsoAspect();
54   anAspect->SetNumber( 0 );
55   Attributes()->SetUIsoAspect( anAspect );
56   anAspect = Attributes()->VIsoAspect();
57   anAspect->SetNumber( 0 );
58   Attributes()->SetVIsoAspect( anAspect );
59   SetColor( GEOM_AISShape::topLevelColor() );
60 }
61
62 GEOM_TopWireframeShape::~GEOM_TopWireframeShape()
63 {
64 }
65
66 Handle(SALOME_InteractiveObject) GEOM_TopWireframeShape::getIO()
67 {
68   Handle(SALOME_InteractiveObject) IO;
69   if ( !GetOwner().IsNull() )
70     IO = Handle(SALOME_InteractiveObject)::DownCast( GetOwner() );
71   return IO;
72 }
73
74 Standard_Boolean GEOM_TopWireframeShape::hasIO()
75 {
76   return !getIO().IsNull();
77 }
78
79 void GEOM_TopWireframeShape::setName( const Standard_CString /*aName*/ )
80 {
81 }
82
83 Standard_CString GEOM_TopWireframeShape::getName()
84 {
85   return "";
86 }
87
88
89 void GEOM_TopWireframeShape::highlightSubShapes( const TColStd_IndexedMapOfInteger& /*aIndexMap*/,
90                                                  const Standard_Boolean /*aHighlight*/ )
91 {
92 }
93
94 Standard_Boolean GEOM_TopWireframeShape::isTopLevel()
95 {
96   return Standard_True;
97 }
98
99 void GEOM_TopWireframeShape::setTopLevel( Standard_Boolean /*f*/ )
100 {
101 }
102
103 Standard_Boolean GEOM_TopWireframeShape::toActivate()
104 {
105   return Standard_True;
106 }
107
108 Standard_Boolean GEOM_TopWireframeShape::switchTopLevel()
109 {
110   return Standard_True;
111 }
112
113 void GEOM_TopWireframeShape::setIO( const Handle(SALOME_InteractiveObject)& io )
114 {
115   SetOwner( io );
116 }