1 // Created by: NW,JPB,CAL
2 // Copyright (c) 1991-1999 Matra Datavision
3 // Copyright (c) 1999-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 // 11/97 ; CAL : retrait DownCast
21 //-Design Declaration of variables specific to groups
24 //-Warning A group is definedv in a structure
25 // This is the smallest editable entity
34 #include <Graphic3d_Group.ixx>
35 #include <Graphic3d_Group.pxx>
37 #include <Graphic3d_GraphicDriver.hxx>
38 #include <Graphic3d_StructureManager.hxx>
39 #include <Graphic3d_TransModeFlags.hxx>
43 //-Global data definitions
51 Graphic3d_Group::Graphic3d_Group (const Handle(Graphic3d_Structure)& AStructure):
54 MyBounds.XMin = ShortRealLast (),
55 MyBounds.YMin = ShortRealLast (),
56 MyBounds.ZMin = ShortRealLast ();
58 MyBounds.XMax = ShortRealFirst (),
59 MyBounds.YMax = ShortRealFirst (),
60 MyBounds.ZMax = ShortRealFirst ();
63 // A small commentary on the usage of This !
65 // Graphic3d_Group is created in a structure. Graphic3d_Structure is a
66 // manager of Graphic3d_Group. In the constructor of Graphic3d_Group
67 // a method Add of Graphic3d_Structure is called. It allows adding
68 // the instance of Graphic3d_Group in its manager. So there are 2 references
69 // to <me> and everything works well.
71 // This () is the instance of the class, the current groupe
72 //Handle(Graphic3d_Group) me = Handle(Graphic3d_Group)::DownCast (This ());
74 MyPtrStructure = (void *) AStructure.operator->();
75 MyStructure->Add (this);
77 MyContainsFacet = Standard_False,
78 MyIsEmpty = Standard_True;
80 MyCGroup.Struct = MyStructure->CStructure().operator->();
81 MyCGroup.Struct->Id = int (MyStructure->Identification ());
82 MyCGroup.ptrGroup = NULL;
84 MyCGroup.ContextLine.IsDef = 0,
85 MyCGroup.ContextText.IsDef = 0,
86 MyCGroup.ContextMarker.IsDef = 0,
87 MyCGroup.ContextFillArea.IsDef = 0;
89 MyCGroup.ContextLine.IsSet = 0,
90 MyCGroup.ContextText.IsSet = 0,
91 MyCGroup.ContextMarker.IsSet = 0,
92 MyCGroup.ContextFillArea.IsSet = 0;
94 MyCGroup.PickId.IsDef = 0,
95 MyCGroup.PickId.IsSet = 0,
96 MyCGroup.PickId.Value = 0;
98 MyGraphicDriver = (MyStructure->StructureManager())->GraphicDriver();
101 MyGraphicDriver->Group (MyCGroup);
105 MyMarkArray.Nullify();