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.
18 //-Design Declaration des variables specifiques aux groupes
21 //-Warning Un groupe est defini dans une structure
22 // Il s'agit de la plus petite entite editable
31 #include <Graphic3d_Group.jxx>
32 #include <Graphic3d_Group.pxx>
36 void Graphic3d_Group::Clear (Standard_Boolean theUpdateStructureMgr)
38 if (IsDeleted ()) return;
40 MyCGroup.ContextLine.IsSet = 0,
41 MyCGroup.ContextText.IsSet = 0,
42 MyCGroup.ContextMarker.IsSet = 0,
43 MyCGroup.ContextFillArea.IsSet = 0;
45 MyCGroup.ContextLine.IsDef = 0,
46 MyCGroup.ContextText.IsDef = 0,
47 MyCGroup.ContextMarker.IsDef = 0,
48 MyCGroup.ContextFillArea.IsDef = 0;
50 MyCGroup.PickId.IsDef = 0,
51 MyCGroup.PickId.IsSet = 0,
52 MyCGroup.PickId.Value = 0;
54 MyBounds.XMin = ShortRealLast (),
55 MyBounds.YMin = ShortRealLast (),
56 MyBounds.ZMin = ShortRealLast ();
58 MyBounds.XMax = ShortRealFirst (),
59 MyBounds.YMax = ShortRealFirst (),
60 MyBounds.ZMax = ShortRealFirst ();
62 if (MyContainsFacet) MyStructure->GroupsWithFacet (-1);
63 MyContainsFacet = Standard_False,
64 MyIsEmpty = Standard_True;
66 MyGraphicDriver->ClearGroup (MyCGroup);
68 // clear method could be used on Graphic3d_Structure destruction,
69 // and its structure manager could be already destroyed, in that
70 // case we don't need to update it;
71 if (theUpdateStructureMgr)
75 void Graphic3d_Group::Destroy ()
77 // tell graphics driver to clear internal resources of the group
78 if (!IsEmpty () && !MyGraphicDriver.IsNull ())
79 MyGraphicDriver->ClearGroup (MyCGroup);
83 void Graphic3d_Group::Remove ()
85 if (IsDeleted ()) return;
87 MyGraphicDriver->RemoveGroup (MyCGroup);
88 MyStructure->Remove (this);
89 MyCGroup.ptrGroup = NULL;
93 MyBounds.XMin = ShortRealLast (),
94 MyBounds.YMin = ShortRealLast (),
95 MyBounds.ZMin = ShortRealLast ();
97 MyBounds.XMax = ShortRealFirst (),
98 MyBounds.YMax = ShortRealFirst (),
99 MyBounds.ZMax = ShortRealFirst ();
101 if (MyContainsFacet) MyStructure->GroupsWithFacet (-1);
102 MyContainsFacet = Standard_False,
103 MyIsEmpty = Standard_True;