1 // Created by: NW,JPB,CAL
2 // Copyright (c) 1991-1999 Matra Datavision
3 // Copyright (c) 1999-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 // 11/97 ; CAL : retrait DownCast
26 //-Design Declaration of variables specific to groups
29 //-Warning A group is definedv in a structure
30 // This is the smallest editable entity
39 #include <Graphic3d_Group.ixx>
40 #include <Graphic3d_Group.pxx>
42 #include <Graphic3d_GraphicDevice.hxx>
43 #include <Graphic3d_GraphicDriver.hxx>
44 #include <Graphic3d_StructureManager.hxx>
45 #include <Graphic3d_TransModeFlags.hxx>
49 //-Global data definitions
57 Graphic3d_Group::Graphic3d_Group (const Handle(Graphic3d_Structure)& AStructure):
60 MyBounds.XMin = ShortRealLast (),
61 MyBounds.YMin = ShortRealLast (),
62 MyBounds.ZMin = ShortRealLast ();
64 MyBounds.XMax = ShortRealFirst (),
65 MyBounds.YMax = ShortRealFirst (),
66 MyBounds.ZMax = ShortRealFirst ();
69 // A small commentary on the usage of This !
71 // Graphic3d_Group is created in a structure. Graphic3d_Structure is a
72 // manager of Graphic3d_Group. In the constructor of Graphic3d_Group
73 // a method Add of Graphic3d_Structure is called. It allows adding
74 // the instance of Graphic3d_Group in its manager. So there are 2 references
75 // to <me> and everything works well.
77 // This () is the instance of the class, the current groupe
78 //Handle(Graphic3d_Group) me = Handle(Graphic3d_Group)::DownCast (This ());
80 Standard_Integer TheLabelBegin, TheLabelEnd;
82 // MyStructure = AStructure;
83 MyPtrStructure = (void *) AStructure.operator->();
84 MyStructure->GroupLabels (TheLabelBegin, TheLabelEnd);
85 MyStructure->Add (this);
87 MyContainsFacet = Standard_False,
88 MyIsEmpty = Standard_True;
90 MyCGroup.Struct = MyStructure->CStructure();
91 MyCGroup.Struct->Id = int (MyStructure->Identification ());
92 MyCGroup.IsDeleted = 0;
94 MyCGroup.LabelBegin = int (TheLabelBegin);
95 MyCGroup.LabelEnd = int (TheLabelEnd);
97 MyCGroup.StructureEnd = Structure_END;
99 MyCGroup.ContextLine.IsDef = 0,
100 MyCGroup.ContextText.IsDef = 0,
101 MyCGroup.ContextMarker.IsDef = 0,
102 MyCGroup.ContextFillArea.IsDef = 0;
104 MyCGroup.ContextLine.IsSet = 0,
105 MyCGroup.ContextText.IsSet = 0,
106 MyCGroup.ContextMarker.IsSet = 0,
107 MyCGroup.ContextFillArea.IsSet = 0;
109 MyCGroup.PickId.IsDef = 0,
110 MyCGroup.PickId.IsSet = 0,
111 MyCGroup.PickId.Value = 0;
113 Handle(Aspect_GraphicDriver) agd =
114 ((MyStructure->StructureManager ())->GraphicDevice ())->GraphicDriver ();
116 MyGraphicDriver = *(Handle(Graphic3d_GraphicDriver) *) &agd;
118 MyGraphicDriver->Group (MyCGroup);
120 //MyCGroup.TransformPersistenceFlag = Graphic3d_TMF_None;
121 //MyCGroup.Struct->TransformPersistenceFlag = Graphic3d_TMF_None;
124 MyMarkArray.Nullify();