b311480e |
1 | // Created by: NW,JPB,CAL |
2 | // Copyright (c) 1991-1999 Matra Datavision |
973c2be1 |
3 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
4 | // |
973c2be1 |
5 | // This file is part of Open CASCADE Technology software library. |
b311480e |
6 | // |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
12 | // |
973c2be1 |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
7fd59977 |
15 | |
7fd59977 |
16 | // 11/97 ; CAL : retrait DownCast |
17 | |
7fd59977 |
18 | |
bf75be98 |
19 | //-Version |
7fd59977 |
20 | |
81bba717 |
21 | //-Design Declaration of variables specific to groups |
22 | // of primitives |
7fd59977 |
23 | |
81bba717 |
24 | //-Warning A group is definedv in a structure |
25 | // This is the smallest editable entity |
7fd59977 |
26 | |
bf75be98 |
27 | //-References |
7fd59977 |
28 | |
29 | //-Language C++ 2.0 |
30 | |
31 | //-Declarations |
32 | |
33 | // for the class |
34 | #include <Graphic3d_Group.ixx> |
35 | #include <Graphic3d_Group.pxx> |
36 | |
7fd59977 |
37 | #include <Graphic3d_GraphicDriver.hxx> |
38 | #include <Graphic3d_StructureManager.hxx> |
39 | #include <Graphic3d_TransModeFlags.hxx> |
40 | |
41 | //-Aliases |
42 | |
43 | //-Global data definitions |
44 | |
45 | //-Constructors |
46 | |
47 | //-Destructors |
48 | |
49 | //-Methods, in order |
50 | |
51 | Graphic3d_Group::Graphic3d_Group (const Handle(Graphic3d_Structure)& AStructure): |
52 | MyListOfPArray() |
53 | { |
54 | MyBounds.XMin = ShortRealLast (), |
55 | MyBounds.YMin = ShortRealLast (), |
56 | MyBounds.ZMin = ShortRealLast (); |
57 | |
58 | MyBounds.XMax = ShortRealFirst (), |
59 | MyBounds.YMax = ShortRealFirst (), |
60 | MyBounds.ZMax = ShortRealFirst (); |
61 | |
62 | // |
81bba717 |
63 | // A small commentary on the usage of This ! |
7fd59977 |
64 | // |
81bba717 |
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. |
7fd59977 |
70 | // |
81bba717 |
71 | // This () is the instance of the class, the current groupe |
7fd59977 |
72 | //Handle(Graphic3d_Group) me = Handle(Graphic3d_Group)::DownCast (This ()); |
73 | |
b8ddfc2f |
74 | MyPtrStructure = (void *) AStructure.operator->(); |
75 | MyStructure->Add (this); |
7fd59977 |
76 | |
b8ddfc2f |
77 | MyContainsFacet = Standard_False, |
78 | MyIsEmpty = Standard_True; |
7fd59977 |
79 | |
b8ddfc2f |
80 | MyCGroup.Struct = MyStructure->CStructure(); |
81 | MyCGroup.Struct->Id = int (MyStructure->Identification ()); |
82 | MyCGroup.ptrGroup = NULL; |
7fd59977 |
83 | |
b8ddfc2f |
84 | MyCGroup.ContextLine.IsDef = 0, |
85 | MyCGroup.ContextText.IsDef = 0, |
86 | MyCGroup.ContextMarker.IsDef = 0, |
87 | MyCGroup.ContextFillArea.IsDef = 0; |
7fd59977 |
88 | |
b8ddfc2f |
89 | MyCGroup.ContextLine.IsSet = 0, |
90 | MyCGroup.ContextText.IsSet = 0, |
91 | MyCGroup.ContextMarker.IsSet = 0, |
92 | MyCGroup.ContextFillArea.IsSet = 0; |
7fd59977 |
93 | |
b8ddfc2f |
94 | MyCGroup.PickId.IsDef = 0, |
95 | MyCGroup.PickId.IsSet = 0, |
96 | MyCGroup.PickId.Value = 0; |
7fd59977 |
97 | |
dc3fe572 |
98 | MyGraphicDriver = (MyStructure->StructureManager())->GraphicDriver(); |
7fd59977 |
99 | |
7fd59977 |
100 | |
b8ddfc2f |
101 | MyGraphicDriver->Group (MyCGroup); |
7fd59977 |
102 | |
b8ddfc2f |
103 | MyMarkWidth = 0; |
104 | MyMarkHeight = 0; |
105 | MyMarkArray.Nullify(); |
7fd59977 |
106 | } |