1 // Created on: 2011-08-01
2 // Created by: Sergey ZERCHANINOV
3 // Copyright (c) 2011-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 #ifndef OpenGl_Structure_Header
22 #define OpenGl_Structure_Header
24 #include <NCollection_List.hxx>
25 #include <InterfaceGraphic_Graphic3d.hxx>
27 #include <OpenGl_AspectLine.hxx>
28 #include <OpenGl_AspectFace.hxx>
29 #include <OpenGl_AspectMarker.hxx>
30 #include <OpenGl_AspectText.hxx>
32 #include <OpenGl_Group.hxx>
33 #include <OpenGl_Matrix.hxx>
35 typedef NCollection_List<const OpenGl_Structure *> OpenGl_ListOfStructure;
36 typedef NCollection_List<const OpenGl_Group *> OpenGl_ListOfGroup;
38 class OpenGl_Structure : public OpenGl_Element
42 virtual ~OpenGl_Structure ();
44 void SetTransformation (const float *AMatrix);
46 void SetTransformPersistence (const CALL_DEF_TRANSFORM_PERSISTENCE &ATransPers);
48 void SetDegenerateModel (const Standard_Integer AMode, const float ASkipRatio);
50 void SetAspectLine (const CALL_DEF_CONTEXTLINE &AContext);
51 void SetAspectFace (const CALL_DEF_CONTEXTFILLAREA &AContext);
52 void SetAspectMarker (const CALL_DEF_CONTEXTMARKER &AContext);
53 void SetAspectText (const CALL_DEF_CONTEXTTEXT &AContext);
55 void SetHighlightBox (const CALL_DEF_BOUNDBOX &ABoundBox);
56 void ClearHighlightBox ();
58 void SetHighlightColor (const Standard_ShortReal R, const Standard_ShortReal G, const Standard_ShortReal B);
59 void ClearHighlightColor ();
61 void SetNamedStatus (const Standard_Integer aStatus) { myNamedStatus = aStatus; }
63 void Connect (const OpenGl_Structure *astructure);
64 void Disconnect (const OpenGl_Structure *astructure);
66 OpenGl_Group * AddGroup ();
67 void RemoveGroup (const OpenGl_Group *);
70 //! Set z layer ID to display the structure in specified layer
71 void SetZLayer (const Standard_Integer theLayerIndex);
74 Standard_Integer GetZLayer () const;
76 virtual void Render (const Handle(OpenGl_Workspace) &AWorkspace) const;
81 OpenGl_Matrix *myTransformation;
82 TEL_TRANSFORM_PERSISTENCE *myTransPers;
83 DEGENERATION *myDegenerateModel;
84 OpenGl_AspectLine *myAspectLine;
85 OpenGl_AspectFace *myAspectFace;
86 OpenGl_AspectMarker *myAspectMarker;
87 OpenGl_AspectText *myAspectText;
88 //Structure_LABHighlight
89 OpenGl_Group *myHighlightBox;
90 TEL_COLOUR *myHighlightColor;
91 //Structure_LABVisibility
93 int myNamedStatus; //Structure_LABNameSet
96 OpenGl_ListOfStructure myConnected;
98 OpenGl_ListOfGroup myGroups;
101 DEFINE_STANDARD_ALLOC
104 #endif //OpenGl_Structure_Header