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.
22 // 27/08/97 ; PCT : ajout coordonnee texture
27 //-Design Declaration des variables specifiques aux groupes
30 //-Warning Un groupe est defini dans une structure
31 // Il s'agit de la plus petite entite editable
39 #include <Graphic3d_Group.jxx>
40 #include <Graphic3d_Group.pxx>
42 void Graphic3d_Group::QuadrangleMesh (const Graphic3d_Array2OfVertex& ListVertex, const Standard_Boolean EvalMinMax) {
44 if (IsDeleted ()) return;
46 if (! MyContainsFacet) MyStructure->GroupsWithFacet (+1);
47 MyContainsFacet = Standard_True;
48 MyIsEmpty = Standard_False;
50 Standard_Real X, Y, Z;
54 Standard_Integer i, j;
55 Standard_Integer LowerRow = ListVertex.LowerRow ();
56 Standard_Integer UpperRow = ListVertex.UpperRow ();
57 Standard_Integer LowerCol = ListVertex.LowerCol ();
58 Standard_Integer UpperCol = ListVertex.UpperCol ();
59 // Parcours des sommets
60 for (i=LowerRow; i<=UpperRow; i++)
61 for (j=LowerCol; j<=UpperCol; j++) {
62 ListVertex (i, j).Coord (X, Y, Z);
63 if (X < MyBounds.XMin) MyBounds.XMin = Standard_ShortReal (X);
64 if (Y < MyBounds.YMin) MyBounds.YMin = Standard_ShortReal (Y);
65 if (Z < MyBounds.ZMin) MyBounds.ZMin = Standard_ShortReal (Z);
66 if (X > MyBounds.XMax) MyBounds.XMax = Standard_ShortReal (X);
67 if (Y > MyBounds.YMax) MyBounds.YMax = Standard_ShortReal (Y);
68 if (Z > MyBounds.ZMax) MyBounds.ZMax = Standard_ShortReal (Z);
72 MyGraphicDriver->QuadrangleMesh (MyCGroup, ListVertex, EvalMinMax);
78 void Graphic3d_Group::QuadrangleMesh (const Graphic3d_Array2OfVertexN& ListVertex, const Standard_Boolean EvalMinMax) {
80 if (IsDeleted ()) return;
82 if (! MyContainsFacet) MyStructure->GroupsWithFacet (+1);
83 MyContainsFacet = Standard_True;
84 MyIsEmpty = Standard_False;
86 Standard_Real X, Y, Z;
88 Standard_Integer i, j;
89 Standard_Integer LowerRow = ListVertex.LowerRow ();
90 Standard_Integer UpperRow = ListVertex.UpperRow ();
91 Standard_Integer LowerCol = ListVertex.LowerCol ();
92 Standard_Integer UpperCol = ListVertex.UpperCol ();
96 // Parcours des sommets
97 for (i=LowerRow; i<=UpperRow; i++)
98 for (j=LowerCol; j<=UpperCol; j++) {
99 ListVertex (i, j).Coord (X, Y, Z);
100 if (X < MyBounds.XMin) MyBounds.XMin = Standard_ShortReal (X);
101 if (Y < MyBounds.YMin) MyBounds.YMin = Standard_ShortReal (Y);
102 if (Z < MyBounds.ZMin) MyBounds.ZMin = Standard_ShortReal (Z);
103 if (X > MyBounds.XMax) MyBounds.XMax = Standard_ShortReal (X);
104 if (Y > MyBounds.YMax) MyBounds.YMax = Standard_ShortReal (Y);
105 if (Z > MyBounds.ZMax) MyBounds.ZMax = Standard_ShortReal (Z);
109 MyGraphicDriver->QuadrangleMesh (MyCGroup, ListVertex, EvalMinMax);
116 void Graphic3d_Group::QuadrangleMesh(const Graphic3d_Array2OfVertexNT& ListVertex,const Standard_Boolean EvalMinMax)
118 if (IsDeleted ()) return;
120 if (! MyContainsFacet) MyStructure->GroupsWithFacet (+1);
121 MyContainsFacet = Standard_True;
122 MyIsEmpty = Standard_False;
124 Standard_Real X, Y, Z;
126 Standard_Integer i, j;
127 Standard_Integer LowerRow = ListVertex.LowerRow ();
128 Standard_Integer UpperRow = ListVertex.UpperRow ();
129 Standard_Integer LowerCol = ListVertex.LowerCol ();
130 Standard_Integer UpperCol = ListVertex.UpperCol ();
134 // Parcours des sommets
135 for (i=LowerRow; i<=UpperRow; i++)
136 for (j=LowerCol; j<=UpperCol; j++) {
137 ListVertex (i, j).Coord (X, Y, Z);
138 if (X < MyBounds.XMin) MyBounds.XMin = Standard_ShortReal (X);
139 if (Y < MyBounds.YMin) MyBounds.YMin = Standard_ShortReal (Y);
140 if (Z < MyBounds.ZMin) MyBounds.ZMin = Standard_ShortReal (Z);
141 if (X > MyBounds.XMax) MyBounds.XMax = Standard_ShortReal (X);
142 if (Y > MyBounds.YMax) MyBounds.YMax = Standard_ShortReal (Y);
143 if (Z > MyBounds.ZMax) MyBounds.ZMax = Standard_ShortReal (Z);
147 MyGraphicDriver->QuadrangleMesh (MyCGroup, ListVertex, EvalMinMax);