@@ -72,40 +72,40 @@ class CurveConverter : public StatusCallback
72
72
{
73
73
}
74
74
75
- void convertIfcCurve2D ( const shared_ptr<IfcCurve>& ifc_curve, std::vector<carve::geom::vector< 2 > >& loops, std::vector<carve::geom::vector< 2 > >& segment_start_points ) const
75
+ void convertIfcCurve2D ( const shared_ptr<IfcCurve>& ifc_curve, std::vector<vec2 >& loops, std::vector<vec2 >& segment_start_points ) const
76
76
{
77
77
std::vector<shared_ptr<IfcTrimmingSelect> > trim1_vec;
78
78
std::vector<shared_ptr<IfcTrimmingSelect> > trim2_vec;
79
79
convertIfcCurve2D ( ifc_curve, loops, segment_start_points, trim1_vec, trim2_vec, true );
80
80
}
81
81
82
- void convertIfcCurve2D ( const shared_ptr<IfcCurve>& ifc_curve, std::vector<carve::geom::vector< 2 > >& target_vec, std::vector<carve::geom::vector< 2 > >& segment_start_points,
82
+ void convertIfcCurve2D ( const shared_ptr<IfcCurve>& ifc_curve, std::vector<vec2 >& target_vec, std::vector<vec2 >& segment_start_points,
83
83
std::vector<shared_ptr<IfcTrimmingSelect> >& trim1_vec, std::vector<shared_ptr<IfcTrimmingSelect> >& trim2_vec, bool sense_agreement ) const
84
84
{
85
- std::vector<carve::geom::vector< 3 > > target_vec_3d;
86
- std::vector<carve::geom::vector< 3 > > segment_start_points_3d;
85
+ std::vector<vec3 > target_vec_3d;
86
+ std::vector<vec3 > segment_start_points_3d;
87
87
convertIfcCurve ( ifc_curve, target_vec_3d, segment_start_points_3d, trim1_vec, trim2_vec, sense_agreement );
88
88
89
89
for ( size_t i = 0 ; i < target_vec_3d.size (); ++i )
90
90
{
91
- carve::geom::vector< 3 > & point_3d = target_vec_3d[i];
91
+ vec3 & point_3d = target_vec_3d[i];
92
92
target_vec.push_back ( carve::geom::VECTOR ( point_3d.x , point_3d.y ) );
93
93
}
94
94
for ( size_t i = 0 ; i < segment_start_points_3d.size (); ++i )
95
95
{
96
- carve::geom::vector< 3 > & point_3d = segment_start_points_3d[i];
96
+ vec3 & point_3d = segment_start_points_3d[i];
97
97
segment_start_points.push_back ( carve::geom::VECTOR ( point_3d.x , point_3d.y ) );
98
98
}
99
99
}
100
100
101
- void convertIfcCurve ( const shared_ptr<IfcCurve>& ifc_curve, std::vector<carve::geom::vector< 3 > >& loops, std::vector<carve::geom::vector< 3 > >& segment_start_points ) const
101
+ void convertIfcCurve ( const shared_ptr<IfcCurve>& ifc_curve, std::vector<vec3 >& loops, std::vector<vec3 >& segment_start_points ) const
102
102
{
103
103
std::vector<shared_ptr<IfcTrimmingSelect> > trim1_vec;
104
104
std::vector<shared_ptr<IfcTrimmingSelect> > trim2_vec;
105
105
convertIfcCurve ( ifc_curve, loops, segment_start_points, trim1_vec, trim2_vec, true );
106
106
}
107
107
108
- void convertIfcCurve ( const shared_ptr<IfcCurve>& ifc_curve, std::vector<carve::geom::vector< 3 > >& target_vec, std::vector<carve::geom::vector< 3 > >& segment_start_points,
108
+ void convertIfcCurve ( const shared_ptr<IfcCurve>& ifc_curve, std::vector<vec3 >& target_vec, std::vector<vec3 >& segment_start_points,
109
109
std::vector<shared_ptr<IfcTrimmingSelect> >& trim1_vec, std::vector<shared_ptr<IfcTrimmingSelect> >& trim2_vec, bool sense_agreement ) const
110
110
{
111
111
double length_factor = m_unit_converter->getLengthInMeterFactor ();
@@ -124,7 +124,7 @@ class CurveConverter : public StatusCallback
124
124
shared_ptr<IfcCompositeCurveSegment> segement = vec_segements[i_segments];
125
125
shared_ptr<IfcCurve> segement_curve = segement->m_ParentCurve ;
126
126
127
- std::vector<carve::geom::vector< 3 > > segment_vec;
127
+ std::vector<vec3 > segment_vec;
128
128
convertIfcCurve ( segement_curve, segment_vec, segment_start_points );
129
129
if ( segment_vec.size () > 0 )
130
130
{
@@ -154,7 +154,7 @@ class CurveConverter : public StatusCallback
154
154
if ( trimmed_curve )
155
155
{
156
156
shared_ptr<IfcCurve> basis_curve = trimmed_curve->m_BasisCurve ;
157
- std::vector<carve::geom::vector< 3 > > basis_curve_points;
157
+ std::vector<vec3 > basis_curve_points;
158
158
std::vector<shared_ptr<IfcTrimmingSelect> >& curve_trim1_vec = trimmed_curve->m_Trim1 ;
159
159
std::vector<shared_ptr<IfcTrimmingSelect> >& curve_trim2_vec = trimmed_curve->m_Trim2 ;
160
160
bool trimmed_sense_agreement = trimmed_curve->m_SenseAgreement ->m_value ;
@@ -204,7 +204,7 @@ class CurveConverter : public StatusCallback
204
204
circle_radius = circle->m_Radius ->m_value *length_factor;
205
205
}
206
206
207
- carve::geom::vector< 3 > circle_center = conic_position_matrix*carve::geom::VECTOR ( 0 , 0 , 0 );
207
+ vec3 circle_center = conic_position_matrix*carve::geom::VECTOR ( 0 , 0 , 0 );
208
208
209
209
double trim_angle1 = 0.0 ;
210
210
double trim_angle2 = M_PI*2.0 ;
@@ -235,7 +235,7 @@ class CurveConverter : public StatusCallback
235
235
shared_ptr<IfcCartesianPoint> trim_point1;
236
236
if ( GeomUtils::findFirstInVector ( trim1_vec, trim_point1 ) )
237
237
{
238
- carve::geom::vector< 3 > trim_point;
238
+ vec3 trim_point;
239
239
PointConverter::convertIfcCartesianPoint ( trim_point1, trim_point, length_factor );
240
240
// TODO: get direction of trim_point to circle_center, get angle. This is more robust in case the trim_point is not exactly on the circle
241
241
trim_angle1 = m_point_converter->getAngleOnCircle ( circle_center, circle_radius, trim_point );
@@ -268,7 +268,7 @@ class CurveConverter : public StatusCallback
268
268
shared_ptr<IfcCartesianPoint> ifc_trim_point;
269
269
if ( GeomUtils::findFirstInVector ( trim2_vec, ifc_trim_point ) )
270
270
{
271
- carve::geom::vector< 3 > trim_point;
271
+ vec3 trim_point;
272
272
PointConverter::convertIfcCartesianPoint ( ifc_trim_point, trim_point, length_factor );
273
273
trim_angle2 = m_point_converter->getAngleOnCircle ( circle_center, circle_radius, trim_point );
274
274
}
@@ -322,7 +322,7 @@ class CurveConverter : public StatusCallback
322
322
if ( num_segments < m_geom_settings->getMinNumVerticesPerArc () ) num_segments = m_geom_settings->getMinNumVerticesPerArc ();
323
323
const double circle_center_x = 0.0 ;
324
324
const double circle_center_y = 0.0 ;
325
- std::vector<carve::geom::vector< 2 > > circle_points;
325
+ std::vector<vec2 > circle_points;
326
326
if ( circle_radius > 0.0 )
327
327
{
328
328
GeomUtils::addArcWithEndPoint ( circle_points, circle_radius, start_angle, opening_angle, circle_center_x, circle_center_y, num_segments );
@@ -337,8 +337,8 @@ class CurveConverter : public StatusCallback
337
337
// apply position
338
338
for ( size_t i = 0 ; i < circle_points.size (); ++i )
339
339
{
340
- carve::geom::vector< 2 > & point = circle_points[i];
341
- carve::geom::vector< 3 > point3d ( carve::geom::VECTOR ( point.x , point.y , 0 ) );
340
+ vec2 & point = circle_points[i];
341
+ vec3 point3d ( carve::geom::VECTOR ( point.x , point.y , 0 ) );
342
342
point3d = conic_position_matrix * point3d;
343
343
point.x = point3d.x ;
344
344
point.y = point3d.y ;
@@ -364,25 +364,25 @@ class CurveConverter : public StatusCallback
364
364
365
365
// todo: implement clipping
366
366
367
- std::vector<carve::geom::vector< 3 > > circle_points;
367
+ std::vector<vec3 > circle_points;
368
368
double angle = 0 ;
369
369
for ( int i = 0 ; i < num_segments; ++i )
370
370
{
371
- circle_points.push_back ( carve::geom::vector< 3 > ( carve::geom::VECTOR ( x_radius * cos ( angle ), y_radius * sin ( angle ), 0 ) ) );
371
+ circle_points.push_back ( vec3 ( carve::geom::VECTOR ( x_radius * cos ( angle ), y_radius * sin ( angle ), 0 ) ) );
372
372
angle += 2.0 *M_PI / double ( num_segments );
373
373
}
374
374
375
375
// apply position
376
376
for ( size_t i = 0 ; i < circle_points.size (); ++i )
377
377
{
378
- carve::geom::vector< 3 > & point = circle_points[i];
378
+ vec3 & point = circle_points[i];
379
379
point = conic_position_matrix * point;
380
380
}
381
381
GeomUtils::appendPointsToCurve ( circle_points, target_vec );
382
382
383
383
// if( segment_start_points != nullptr )
384
384
{
385
- carve::geom::vector< 3 > pt0 = circle_points[0 ];
385
+ vec3 pt0 = circle_points[0 ];
386
386
segment_start_points.push_back ( pt0 );
387
387
}
388
388
}
@@ -396,7 +396,7 @@ class CurveConverter : public StatusCallback
396
396
if ( line )
397
397
{
398
398
shared_ptr<IfcCartesianPoint> ifc_line_point = line->m_Pnt ;
399
- carve::geom::vector< 3 > line_origin;
399
+ vec3 line_origin;
400
400
if ( PointConverter::convertIfcCartesianPoint ( ifc_line_point, line_origin, length_factor ) )
401
401
{
402
402
// line: lambda(u) = line_point + u*line_direction
@@ -408,7 +408,7 @@ class CurveConverter : public StatusCallback
408
408
shared_ptr<IfcDirection> ifc_line_direction = line_vec->m_Orientation ;
409
409
410
410
std::vector<shared_ptr<IfcReal> >& direction_ratios = ifc_line_direction->m_DirectionRatios ;
411
- carve::geom::vector< 3 > line_direction;
411
+ vec3 line_direction;
412
412
if ( direction_ratios.size () > 1 )
413
413
{
414
414
if ( direction_ratios.size () > 2 )
@@ -438,10 +438,10 @@ class CurveConverter : public StatusCallback
438
438
shared_ptr<IfcCartesianPoint> ifc_trim_point;
439
439
if ( GeomUtils::findFirstInVector ( trim1_vec, ifc_trim_point ) )
440
440
{
441
- carve::geom::vector< 3 > trim_point;
441
+ vec3 trim_point;
442
442
PointConverter::convertIfcCartesianPoint ( ifc_trim_point, trim_point, length_factor );
443
443
444
- carve::geom::vector< 3 > closest_point_on_line;
444
+ vec3 closest_point_on_line;
445
445
GeomUtils::closestPointOnLine ( trim_point, line_origin, line_direction, closest_point_on_line );
446
446
447
447
if ( ( closest_point_on_line - trim_point ).length () < 0.0001 )
@@ -452,7 +452,7 @@ class CurveConverter : public StatusCallback
452
452
}
453
453
}
454
454
// check for trimming at end of line
455
- carve::geom::vector< 3 > line_end;
455
+ vec3 line_end;
456
456
shared_ptr<IfcParameterValue> trim_par2;
457
457
if ( GeomUtils::findFirstInVector ( trim2_vec, trim_par2 ) )
458
458
{
@@ -464,10 +464,10 @@ class CurveConverter : public StatusCallback
464
464
shared_ptr<IfcCartesianPoint> ifc_trim_point;
465
465
if ( GeomUtils::findFirstInVector ( trim2_vec, ifc_trim_point ) )
466
466
{
467
- carve::geom::vector< 3 > trim_point;
467
+ vec3 trim_point;
468
468
PointConverter::convertIfcCartesianPoint ( ifc_trim_point, trim_point, length_factor );
469
469
470
- carve::geom::vector< 3 > closest_point_on_line;
470
+ vec3 closest_point_on_line;
471
471
GeomUtils::closestPointOnLine ( trim_point, line_origin, line_direction, closest_point_on_line );
472
472
473
473
if ( ( closest_point_on_line - trim_point ).length () < 0.0001 )
@@ -478,7 +478,7 @@ class CurveConverter : public StatusCallback
478
478
}
479
479
}
480
480
481
- std::vector<carve::geom::vector< 3 > > points_vec;
481
+ std::vector<vec3 > points_vec;
482
482
points_vec.push_back ( line_origin );
483
483
points_vec.push_back ( line_end );
484
484
@@ -517,12 +517,12 @@ class CurveConverter : public StatusCallback
517
517
}
518
518
519
519
520
- void convertIfcPolyline ( const shared_ptr<IfcPolyline>& poly_line, std::vector<carve::geom::vector< 3 > >& loop ) const
520
+ void convertIfcPolyline ( const shared_ptr<IfcPolyline>& poly_line, std::vector<vec3 >& loop ) const
521
521
{
522
522
m_point_converter->convertIfcCartesianPointVector ( poly_line->m_Points , loop );
523
523
}
524
524
525
- void convertIfcLoop ( const shared_ptr<IfcLoop>& loop, std::vector<carve::geom::vector< 3 > >& loop_points ) const
525
+ void convertIfcLoop ( const shared_ptr<IfcLoop>& loop, std::vector<vec3 >& loop_points ) const
526
526
{
527
527
const shared_ptr<IfcPolyLoop> poly_loop = dynamic_pointer_cast<IfcPolyLoop>( loop );
528
528
if ( poly_loop )
0 commit comments