Skip to content

Commit a88f27f

Browse files
committed
update SimpleViewerExampleQt to Qt6
1 parent b938bf7 commit a88f27f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1857
-2021
lines changed

IfcPlusPlus/IfcPlusPlus.vcxproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@
253253
<IntrinsicFunctions>false</IntrinsicFunctions>
254254
<AdditionalIncludeDirectories>.;.\src;src\ifcpp;src\ifcpp\IFC4X3\include;.\src\external\;.\src\external\RapidJSON;.\src\external\glm;src/external/Carve;src/external/Carve/src;src/external/Carve/src/common;src/external/Carve/src/lib;src/external/Carve/src/include;src/external/Carve/src/include/carve;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
255255
<MultiProcessorCompilation>true</MultiProcessorCompilation>
256-
<PreprocessorDefinitions>UNICODE;WIN32;_WINDOWS;NDEBUG;_MBCS;IFCQUERY_LIB;IFCQUERY_STATIC_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
256+
<PreprocessorDefinitions>UNICODE;WIN32;_WINDOWS;NDEBUG;_MBCS;IFCQUERY_LIB;IFCQUERY_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
257257
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
258258
<FloatingPointExceptions>true</FloatingPointExceptions>
259259
<RuntimeTypeInfo>true</RuntimeTypeInfo>

IfcPlusPlus/src/external/Carve/src/common/geometry.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ carve::mesh::MeshSet<3>* makeSubdividedCube(
7575
}
7676
}
7777
}
78-
#define OK(x, y, z) \
78+
#define VectorOK(x, y, z) \
7979
((x) >= 0 && (x) < sub_x && (y) >= 0 && (y) < sub_y && (z) >= 0 && \
8080
(z) < sub_z)
8181
#define I(x, y, z) ((x) + (y) * (sub_x + 1) + (z) * ((sub_x + 1) * (sub_y + 1)))
@@ -94,22 +94,22 @@ carve::mesh::MeshSet<3>* makeSubdividedCube(
9494
if( !inc(_x, _y, _z) ) {
9595
continue;
9696
}
97-
if( !OK(_x - 1, _y, _z) || !inc(_x - 1, _y, _z) ) {
97+
if( !VectorOK(_x - 1, _y, _z) || !inc(_x - 1, _y, _z) ) {
9898
FACE(3, 7, 4, 0);
9999
}
100-
if( !OK(_x + 1, _y, _z) || !inc(_x + 1, _y, _z) ) {
100+
if( !VectorOK(_x + 1, _y, _z) || !inc(_x + 1, _y, _z) ) {
101101
FACE(1, 5, 6, 2);
102102
}
103-
if( !OK(_x, _y - 1, _z) || !inc(_x, _y - 1, _z) ) {
103+
if( !VectorOK(_x, _y - 1, _z) || !inc(_x, _y - 1, _z) ) {
104104
FACE(0, 4, 5, 1);
105105
}
106-
if( !OK(_x, _y + 1, _z) || !inc(_x, _y + 1, _z) ) {
106+
if( !VectorOK(_x, _y + 1, _z) || !inc(_x, _y + 1, _z) ) {
107107
FACE(2, 6, 7, 3);
108108
}
109-
if( !OK(_x, _y, _z - 1) || !inc(_x, _y, _z - 1) ) {
109+
if( !VectorOK(_x, _y, _z - 1) || !inc(_x, _y, _z - 1) ) {
110110
FACE(0, 1, 2, 3);
111111
}
112-
if( !OK(_x, _y, _z + 1) || !inc(_x, _y, _z + 1) ) {
112+
if( !VectorOK(_x, _y, _z + 1) || !inc(_x, _y, _z + 1) ) {
113113
FACE(7, 6, 5, 4);
114114
}
115115
}

IfcPlusPlus/src/external/Carve/src/include/carve/geom.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ namespace carve {
296296

297297
vector_t D, v;
298298

299-
bool OK(double CARVE_EPSILON) const;
299+
bool RayOK(double CARVE_EPSILON) const;
300300

301301
ray() {}
302302
ray(vector_t _D, vector_t _v) : D(_D), v(_v) {}
@@ -324,7 +324,7 @@ namespace carve {
324324
vector_t half_length;
325325

326326
void update();
327-
bool OK(double CARVE_EPSILON) const;
327+
bool LineSegmentOK(double CARVE_EPSILON) const;
328328
void flip();
329329

330330
aabb<ndim> getAABB() const;

IfcPlusPlus/src/external/Carve/src/include/carve/geom_impl.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ namespace carve {
609609
}
610610

611611
template <unsigned int ndim>
612-
bool ray<ndim>::OK(double CARVE_EPSILON) const
612+
bool ray<ndim>::RayOK(double CARVE_EPSILON) const
613613
{
614614
return !D.isZero(CARVE_EPSILON);
615615
}
@@ -643,7 +643,7 @@ namespace carve {
643643
}
644644

645645
template <unsigned int ndim>
646-
bool linesegment<ndim>::OK(double CARVE_EPSILON) const {
646+
bool linesegment<ndim>::LineSegmentOK(double CARVE_EPSILON) const {
647647
return !half_length.isZero(CARVE_EPSILON);
648648
}
649649

IfcPlusPlus/src/external/Carve/src/lib/face.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ namespace carve {
233233
template <unsigned int ndim>
234234
bool Face<ndim>::simpleLineSegmentIntersection( const carve::geom::linesegment<ndim>& line, vector_t& intersection, double CARVE_EPSILON) const
235235
{
236-
if( !line.OK(CARVE_EPSILON) )
236+
if( !line.LineSegmentOK(CARVE_EPSILON) )
237237
{
238238
return false;
239239
}
@@ -260,7 +260,7 @@ namespace carve {
260260
template <unsigned int ndim>
261261
IntersectionClass Face<ndim>::lineSegmentIntersection( const carve::geom::linesegment<ndim>& line, vector_t& intersection, double CARVE_EPSILON) const
262262
{
263-
if( !line.OK(CARVE_EPSILON) ) {
263+
if( !line.LineSegmentOK(CARVE_EPSILON) ) {
264264
return INTERSECT_NONE;
265265
}
266266

IfcPlusPlus/src/external/Carve/src/lib/geom3d.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ namespace carve {
145145

146146
RayIntersectionClass rayRayIntersection(const Ray& r1, const Ray& r2, Vector& v1, Vector& v2, double& mu1, double& mu2, double CARVE_EPSILON)
147147
{
148-
if( !r1.OK(CARVE_EPSILON) || !r2.OK(CARVE_EPSILON) )
148+
if( !r1.RayOK(CARVE_EPSILON) || !r2.RayOK(CARVE_EPSILON) )
149149
{
150150
return RR_DEGENERATE;
151151
}

IfcPlusPlus/src/external/Carve/src/lib/intersect.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -1603,6 +1603,11 @@ carve::mesh::MeshSet<3>* carve::csg::CSG::compute( meshset_t* a, meshset_t* b, c
16031603
*/
16041604
carve::mesh::MeshSet<3>* carve::csg::CSG::compute( meshset_t* a, meshset_t* b, carve::csg::CSG::OP op, carve::csg::V2Set* shared_edges, CLASSIFY_TYPE classify_type)
16051605
{
1606+
if (a->vertex_storage.size() == 0 || b->vertex_storage.size() ==0)
1607+
{
1608+
return nullptr;
1609+
}
1610+
16061611
Collector* coll = makeCollector(op, a, b);
16071612
if( !coll ) {
16081613
return nullptr;

IfcPlusPlus/src/external/Carve/src/lib/mesh.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ namespace carve {
170170
template <unsigned int ndim>
171171
bool Face<ndim>::simpleLineSegmentIntersection( const carve::geom::linesegment<ndim>& line, vector_t& intersection, double CARVE_EPSILON) const
172172
{
173-
if( !line.OK(CARVE_EPSILON) ) {
173+
if( !line.LineSegmentOK(CARVE_EPSILON) ) {
174174
return false;
175175
}
176176

@@ -193,7 +193,7 @@ namespace carve {
193193
template <unsigned int ndim>
194194
IntersectionClass Face<ndim>::lineSegmentIntersection( const carve::geom::linesegment<ndim>& line, vector_t& intersection, double CARVE_EPSILON) const
195195
{
196-
if( !line.OK(CARVE_EPSILON) )
196+
if( !line.LineSegmentOK(CARVE_EPSILON) )
197197
{
198198
return INTERSECT_NONE;
199199
}

IfcPlusPlus/src/external/Carve/src/lib/shewchuk_predicates.cpp

+64-65
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,11 @@
116116
#include <math.h>
117117
#include <stdio.h>
118118
#include <stdlib.h>
119-
//#include <sys/time.h>
119+
#include <random>
120120

121-
#if defined(_MSC_VER)
122-
int random() { return rand(); }
123-
#endif
121+
//#if defined(_MSC_VER)
122+
//long random() { return rand(); }
123+
//#endif
124124

125125

126126
/* On some machines, the exact arithmetic routines might be defeated by the */
@@ -518,23 +518,23 @@ double *e;
518518
/* */
519519
/*****************************************************************************/
520520

521-
double doublerand() {
522-
double result;
523-
double expo;
524-
long a, b, c;
525-
long i;
526-
527-
a = random();
528-
b = random();
529-
c = random();
530-
result = (double)(a - 1073741824) * 8388608.0 + (double)(b >> 8);
531-
for (i = 512, expo = 2; i <= 131072; i *= 2, expo = expo * expo) {
532-
if (c & i) {
533-
result *= expo;
534-
}
535-
}
536-
return result;
537-
}
521+
//double doublerand() {
522+
// double result;
523+
// double expo;
524+
// long a, b, c;
525+
// long i;
526+
//
527+
// a = random();
528+
// b = random();
529+
// c = random();
530+
// result = (double)(a - 1073741824) * 8388608.0 + (double)(b >> 8);
531+
// for (i = 512, expo = 2; i <= 131072; i *= 2, expo = expo * expo) {
532+
// if (c & i) {
533+
// result *= expo;
534+
// }
535+
// }
536+
// return result;
537+
//}
538538

539539
/*****************************************************************************/
540540
/* */
@@ -543,39 +543,39 @@ double doublerand() {
543543
/* */
544544
/*****************************************************************************/
545545

546-
double narrowdoublerand() {
547-
double result;
548-
double expo;
549-
long a, b, c;
550-
long i;
551-
552-
a = random();
553-
b = random();
554-
c = random();
555-
result = (double)(a - 1073741824) * 8388608.0 + (double)(b >> 8);
556-
for (i = 512, expo = 2; i <= 2048; i *= 2, expo = expo * expo) {
557-
if (c & i) {
558-
result *= expo;
559-
}
560-
}
561-
return result;
562-
}
546+
//double narrowdoublerand() {
547+
// double result;
548+
// double expo;
549+
// long a, b, c;
550+
// long i;
551+
//
552+
// a = random();
553+
// b = random();
554+
// c = random();
555+
// result = (double)(a - 1073741824) * 8388608.0 + (double)(b >> 8);
556+
// for (i = 512, expo = 2; i <= 2048; i *= 2, expo = expo * expo) {
557+
// if (c & i) {
558+
// result *= expo;
559+
// }
560+
// }
561+
// return result;
562+
//}
563563

564564
/*****************************************************************************/
565565
/* */
566566
/* uniformdoublerand() Generate a double with random 53-bit significand. */
567567
/* */
568568
/*****************************************************************************/
569-
570-
double uniformdoublerand() {
571-
double result;
572-
long a, b;
573-
574-
a = random();
575-
b = random();
576-
result = (double)(a - 1073741824) * 8388608.0 + (double)(b >> 8);
577-
return result;
578-
}
569+
//
570+
//double uniformdoublerand() {
571+
// double result;
572+
// long a, b;
573+
//
574+
// a = random();
575+
// b = random();
576+
// result = (double)(a - 1073741824) * 8388608.0 + (double)(b >> 8);
577+
// return result;
578+
//}
579579

580580
/*****************************************************************************/
581581
/* */
@@ -590,24 +590,23 @@ double uniformdoublerand() {
590590
/* */
591591
/*****************************************************************************/
592592

593-
int grow_expansion(int elen, double* e, double b,
594-
double* h) /* e and h can be the same. */
593+
int grow_expansion(int elen, double* e, double b, double* h) /* e and h can be the same. */
595594
{
596-
double Q;
597-
INEXACT double Qnew;
598-
int eindex;
599-
double enow;
600-
INEXACT double bvirt;
601-
double avirt, bround, around;
602-
603-
Q = b;
604-
for (eindex = 0; eindex < elen; eindex++) {
605-
enow = e[eindex];
606-
Two_Sum(Q, enow, Qnew, h[eindex]);
607-
Q = Qnew;
608-
}
609-
h[eindex] = Q;
610-
return eindex + 1;
595+
double Q;
596+
INEXACT double Qnew;
597+
int eindex;
598+
double enow;
599+
INEXACT double bvirt;
600+
double avirt, bround, around;
601+
602+
Q = b;
603+
for (eindex = 0; eindex < elen; eindex++) {
604+
enow = e[eindex];
605+
Two_Sum(Q, enow, Qnew, h[eindex]);
606+
Q = Qnew;
607+
}
608+
h[eindex] = Q;
609+
return eindex + 1;
611610
}
612611

613612
/*****************************************************************************/

IfcPlusPlus/src/ifcpp/geometry/CSG_Adapter.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OU
3131

3232
#if defined(_DEBUG) || defined(_DEBUG_RELEASE)
3333
static int csg_compute_count = 0;
34-
#define CSG_DEBUG
34+
//#define CSG_DEBUG
3535
#endif
3636

3737
class CSG_Adapter

IfcPlusPlus/src/ifcpp/geometry/ConverterOSG.h

+14-14
Original file line numberDiff line numberDiff line change
@@ -1233,20 +1233,20 @@ class ConverterOSG : public StatusCallback
12331233
float transparency = appearence->m_transparency;
12341234
bool set_transparent = appearence->m_set_transparent;
12351235

1236-
const float color_ambient_r = appearence->m_color_ambient.r;
1237-
const float color_ambient_g = appearence->m_color_ambient.g;
1238-
const float color_ambient_b = appearence->m_color_ambient.b;
1239-
const float color_ambient_a = appearence->m_color_ambient.a;
1240-
1241-
const float color_diffuse_r = appearence->m_color_diffuse.r;
1242-
const float color_diffuse_g = appearence->m_color_diffuse.g;
1243-
const float color_diffuse_b = appearence->m_color_diffuse.b;
1244-
const float color_diffuse_a = appearence->m_color_diffuse.a;
1245-
1246-
const float color_specular_r = appearence->m_color_specular.r;
1247-
const float color_specular_g = appearence->m_color_specular.g;
1248-
const float color_specular_b = appearence->m_color_specular.b;
1249-
const float color_specular_a = appearence->m_color_specular.a;
1236+
const float color_ambient_r = appearence->m_color_ambient.x;
1237+
const float color_ambient_g = appearence->m_color_ambient.y;
1238+
const float color_ambient_b = appearence->m_color_ambient.z;
1239+
const float color_ambient_a = appearence->m_color_ambient.w;
1240+
1241+
const float color_diffuse_r = appearence->m_color_diffuse.x;
1242+
const float color_diffuse_g = appearence->m_color_diffuse.y;
1243+
const float color_diffuse_b = appearence->m_color_diffuse.z;
1244+
const float color_diffuse_a = appearence->m_color_diffuse.w;
1245+
1246+
const float color_specular_r = appearence->m_color_specular.x;
1247+
const float color_specular_g = appearence->m_color_specular.y;
1248+
const float color_specular_b = appearence->m_color_specular.z;
1249+
const float color_specular_a = appearence->m_color_specular.w;
12501250

12511251
if (transparencyOverride > 0)
12521252
{

0 commit comments

Comments
 (0)