You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: BGL/include/CGAL/boost/graph/IO/GOCAD.h
+10Lines changed: 10 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -103,6 +103,11 @@ class GOCAD_builder
103
103
/// \cgalParamType{Boolean}
104
104
/// \cgalParamDefault{`false`}
105
105
/// \cgalParamNEnd
106
+
/// \cgalParamNBegin{read_only_one_object}
107
+
/// \cgalParamDescription{if `true` only one GOCAD object will be read in the stream, and the stream will be left ready for the reading of the next GOCAD object.}
108
+
/// \cgalParamType{Boolean}
109
+
/// \cgalParamDefault{`false`}
110
+
/// \cgalParamNEnd
106
111
/// \cgalNamedParamsEnd
107
112
///
108
113
/// \returns `true` if reading was successful and the resulting mesh is valid, `false` otherwise.
/// \cgalParamDescription{if `true` only one GOCAD object will be read in the stream, and the stream will be left ready for the reading of the next GOCAD object.}
185
+
/// \cgalParamType{Boolean}
186
+
/// \cgalParamDefault{`false`}
187
+
/// \cgalParamNEnd
178
188
/// \cgalNamedParamsEnd
179
189
///
180
190
/// \sa Overloads of this function for specific models of the concept `FaceGraph`.
if(line.find("GOCAD ") != std::string::npos) //the whitespace matters, it is used to define a gocad type, but not in the coord system keyword, for example.
110
-
nb_gocad++;
111
-
112
-
if((line.find("VRTX") != std::string::npos))
95
+
elseif(s=="VRTX")
113
96
{
114
97
int i;
115
98
double x, y, z;
116
-
if(!(iss >> s >> i >> IO::iformat(x) >> IO::iformat(y) >> IO::iformat(z)))
99
+
if(!(iss >> i >> IO::iformat(x) >> IO::iformat(y) >> IO::iformat(z)))
117
100
{
118
101
if(verbose)
119
102
std::cerr << "error while reading vertex." << std::endl;
@@ -123,18 +106,14 @@ bool read_GOCAD(std::istream& is,
123
106
if(!vertices_read)
124
107
{
125
108
vertices_read = true;
126
-
offset -= i; // Some files start with index 0 others with 1
109
+
l_offset = -i;
127
110
}
128
111
129
112
internal::fill_point(x, y, z, 1., p);
130
113
points.push_back(p);
131
114
}
132
-
elseif(line[0] == 'T')
115
+
elseif(s == "TRGL")
133
116
{
134
-
iss >> s;
135
-
if(s != "TRGL")
136
-
continue;
137
-
138
117
int i,j,k;
139
118
if(!(iss >> i >> j >> k))
140
119
{
@@ -145,20 +124,40 @@ bool read_GOCAD(std::istream& is,
@@ -187,6 +186,11 @@ bool read_GOCAD(std::istream& is,
187
186
* \cgalParamType{Boolean}
188
187
* \cgalParamDefault{`false`}
189
188
* \cgalParamNEnd
189
+
* \cgalParamNBegin{read_only_one_object}
190
+
* \cgalParamDescription{if `true` only one GOCAD object will be read in the stream, and the stream will be left ready for the reading of the next GOCAD object.}
191
+
* \cgalParamType{Boolean}
192
+
* \cgalParamDefault{`false`}
193
+
* \cgalParamNEnd
190
194
* \cgalNamedParamsEnd
191
195
*
192
196
* \returns `true` if the reading was successful, `false` otherwise.
@@ -230,6 +234,11 @@ bool read_GOCAD(std::istream& is,
230
234
* \cgalParamType{Boolean}
231
235
* \cgalParamDefault{`false`}
232
236
* \cgalParamNEnd
237
+
* \cgalParamNBegin{read_only_one_object}
238
+
* \cgalParamDescription{if `true` only one GOCAD object will be read in the stream, and the stream will be left ready for the reading of the next GOCAD object.}
239
+
* \cgalParamType{Boolean}
240
+
* \cgalParamDefault{`false`}
241
+
* \cgalParamNEnd
233
242
* \cgalNamedParamsEnd
234
243
*
235
244
* \returns `true` if the reading was successful, `false` otherwise.
0 commit comments