Skip to content

Commit b675b93

Browse files
committed
clean up VS project files
1 parent c614aa1 commit b675b93

10 files changed

+56
-385
lines changed

Diff for: .gitignore

+2-9
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,13 @@ bin
2727
bin32
2828
/build/
2929
.hg/
30-
examples/LoadFileExampleNoGUI/LoadFileExampleNoGUI/example.ifc
3130
examples/SimpleViewerExampleQt/dumpEntity.ifc
3231
examples/SimpleViewerExampleQt/SimpleWall.ifc
3332
examples/SimpleViewerExampleQt/GeneratedFiles/
3433
examples/SimpleViewerExampleQt/dump_mesh_debug.txt
35-
examples/SimpleViewerExampleMFC/dump_mesh_debug.txt
36-
examples/SimpleViewerExampleMFC/x64/
37-
examples/SimpleViewerExampleMFC/.vs/IfcQueryViewer/v15/.suo
38-
examples/SimpleViewerExampleMFC/.vs/SimpleViewerExampleMFC/v15/.suo
39-
examples/CreateIfcWallAndWriteFile/CreateIfcWallAndWriteFile/x64/
40-
examples/CreateIfcWallAndWriteFile/CreateIfcWallAndWriteFile/SimpleWall.ifc
41-
examples/CreateIfcWallAndWriteFile/SimpleWall.ifc
42-
examples/LoadFileExampleNoGUI/LoadFileExampleNoGUI/x64/
4334
external/Carve/build/
4435
examples/CreateIfcWallAndWriteFile/x64/
36+
examples/CreateIfcWallAndWriteFile/SimpleWall.ifc
4537
examples/LoadFileWithGeometryExampleConsole/dump_mesh_debug.txt
4638
IfcPlusPlus-*
4739
IfcPlusPlus/src/ifcpp/geometry/Carve - Copy/
@@ -56,3 +48,4 @@ examples/SimpleViewerExampleQt/SimpleViewerExampleQt.vcxproj.user
5648
.vs/IfcPlusPlus/v17/DocumentLayout.json
5749
examples/SimpleViewerExampleQt/.vs/SimpleViewerExampleQt/v17/DocumentLayout.json
5850
examples/LoadFileExample/.vs/LoadFileExample/v17/DocumentLayout.json
51+
examples/SimpleViewerExampleQt2/

Diff for: examples/SimpleViewerExampleQt/SimpleViewerExampleQt.sln

-12
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,13 @@ EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1010
Debug|x64 = Debug|x64
11-
Debug|x86 = Debug|x86
1211
Release|x64 = Release|x64
13-
Release|x86 = Release|x86
14-
ReleaseWithDebugInfo|x64 = ReleaseWithDebugInfo|x64
15-
ReleaseWithDebugInfo|x86 = ReleaseWithDebugInfo|x86
1612
EndGlobalSection
1713
GlobalSection(ProjectConfigurationPlatforms) = postSolution
1814
{B12702AD-ABFB-343A-A199-8E24837244A3}.Debug|x64.ActiveCfg = Debug|x64
1915
{B12702AD-ABFB-343A-A199-8E24837244A3}.Debug|x64.Build.0 = Debug|x64
20-
{B12702AD-ABFB-343A-A199-8E24837244A3}.Debug|x86.ActiveCfg = Debug|Win32
21-
{B12702AD-ABFB-343A-A199-8E24837244A3}.Debug|x86.Build.0 = Debug|Win32
2216
{B12702AD-ABFB-343A-A199-8E24837244A3}.Release|x64.ActiveCfg = Release|x64
2317
{B12702AD-ABFB-343A-A199-8E24837244A3}.Release|x64.Build.0 = Release|x64
24-
{B12702AD-ABFB-343A-A199-8E24837244A3}.Release|x86.ActiveCfg = Release|Win32
25-
{B12702AD-ABFB-343A-A199-8E24837244A3}.Release|x86.Build.0 = Release|Win32
26-
{B12702AD-ABFB-343A-A199-8E24837244A3}.ReleaseWithDebugInfo|x64.ActiveCfg = ReleaseWithDebugInfo|x64
27-
{B12702AD-ABFB-343A-A199-8E24837244A3}.ReleaseWithDebugInfo|x64.Build.0 = ReleaseWithDebugInfo|x64
28-
{B12702AD-ABFB-343A-A199-8E24837244A3}.ReleaseWithDebugInfo|x86.ActiveCfg = ReleaseWithDebugInfo|Win32
29-
{B12702AD-ABFB-343A-A199-8E24837244A3}.ReleaseWithDebugInfo|x86.Build.0 = ReleaseWithDebugInfo|Win32
3018
EndGlobalSection
3119
GlobalSection(SolutionProperties) = preSolution
3220
HideSolutionNode = FALSE

Diff for: examples/SimpleViewerExampleQt/SimpleViewerExampleQt.vcxproj

-284
Large diffs are not rendered by default.

Diff for: examples/SimpleViewerExampleQt/SimpleViewerExampleQt.vcxproj.user

+2-27
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,10 @@
1111
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
1212
<LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b$(IFCPP_DIR)\IfcPlusPlus\bin%3b$(QTDIR)\bin%3b$(OSG_DIR)\build\bin%3b$(PATH)</LocalDebuggerEnvironment>
1313
</PropertyGroup>
14-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|x64'">
15-
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
16-
<LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b$(IFCPP_DIR)\IfcPlusPlus\bin%3b$(QTDIR)\bin%3b$(OSG_DIR)\build\bin%3b$(PATH)</LocalDebuggerEnvironment>
17-
</PropertyGroup>
18-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
19-
<LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b"$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment>
20-
</PropertyGroup>
21-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
22-
<LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b"$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment>
23-
</PropertyGroup>
24-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">
25-
<LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b"$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment>
26-
</PropertyGroup>
27-
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
28-
<QtLastBackgroundBuild>2024-04-28T15:34:49.2973776Z</QtLastBackgroundBuild>
29-
</PropertyGroup>
3014
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
31-
<QtLastBackgroundBuild>2024-04-28T15:34:49.4550337Z</QtLastBackgroundBuild>
32-
</PropertyGroup>
33-
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
34-
<QtLastBackgroundBuild>2024-04-28T15:34:49.6528594Z</QtLastBackgroundBuild>
35-
</PropertyGroup>
36-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'" Label="QtSettings">
37-
<QtLastBackgroundBuild>2024-04-28T15:34:48.8076472Z</QtLastBackgroundBuild>
15+
<QtLastBackgroundBuild>2024-04-30T05:42:20.7568924Z</QtLastBackgroundBuild>
3816
</PropertyGroup>
3917
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
40-
<QtLastBackgroundBuild>2024-04-28T15:34:49.8299991Z</QtLastBackgroundBuild>
41-
</PropertyGroup>
42-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|x64'" Label="QtSettings">
43-
<QtLastBackgroundBuild>2024-04-28T15:34:49.1260649Z</QtLastBackgroundBuild>
18+
<QtLastBackgroundBuild>2024-04-30T05:42:20.8565894Z</QtLastBackgroundBuild>
4419
</PropertyGroup>
4520
</Project>

Diff for: examples/SimpleViewerExampleQt/src/gui/MainWindow.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ void MainWindow::slotSettingsClicked()
326326
if (m_labelAbout->isVisible()) { m_labelAbout->hide(); }
327327

328328
int w = m_viewerWidget->width() - 40;
329-
int h = 180;
329+
int h = 250;
330330
m_settingsWidget->setParent(m_viewerWidget);
331331
m_settingsWidget->setGeometry(40, 0, w, h);
332332
m_settingsWidget->setVisible(true);

Diff for: examples/SimpleViewerExampleQt/src/gui/OpenFileWidget.cpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,8 @@ void OpenFileWidget::loadIfcFile( QString& path_in )
295295
setEnabled(false);
296296

297297
// first remove previously loaded geometry from scenegraph
298-
osg::ref_ptr<osg::Switch> model_switch = m_system->getViewController()->getModelNode();
299-
SceneGraphUtils::clearAllChildNodes(model_switch);
298+
osg::ref_ptr<osg::Group> modelNode = m_system->getViewController()->getModelNode();
299+
SceneGraphUtils::clearAllChildNodes(modelNode);
300300
m_system->clearSelection();
301301

302302
// reset the IFC model
@@ -319,38 +319,38 @@ void OpenFileWidget::loadIfcFile( QString& path_in )
319319
// convert Carve geometry to OSG
320320
shared_ptr<ConverterOSG> converter_osg(new ConverterOSG(geometry_converter->getGeomSettings()));
321321
converter_osg->setMessageTarget(geometry_converter.get());
322-
converter_osg->convertToOSG(geometry_converter->getShapeInputData(), model_switch);
322+
converter_osg->convertToOSG(geometry_converter->getShapeInputData(), modelNode);
323323

324-
if (model_switch)
324+
if (modelNode)
325325
{
326326
bool optimize = true;
327327
if (optimize)
328328
{
329329
osgUtil::Optimizer opt;
330-
opt.optimize(model_switch);
330+
opt.optimize(modelNode);
331331
}
332332

333333
// if model bounding sphere is far from origin, move to origin
334-
const osg::BoundingSphere& bsphere = model_switch->getBound();
334+
const osg::BoundingSphere& bsphere = modelNode->getBound();
335335
if (bsphere.center().length() > 10000)
336336
{
337337
if (bsphere.center().length() / bsphere.radius() > 100)
338338
{
339339
osg::MatrixTransform* mt = new osg::MatrixTransform();
340340
mt->setMatrix(osg::Matrix::translate(-bsphere.center() * 0.98));
341341

342-
int num_children = model_switch->getNumChildren();
342+
int num_children = modelNode->getNumChildren();
343343
for (int i = 0; i < num_children; ++i)
344344
{
345-
osg::Node* node = model_switch->getChild(i);
345+
osg::Node* node = modelNode->getChild(i);
346346
if (!node)
347347
{
348348
continue;
349349
}
350350
mt->addChild(node);
351351
}
352-
SceneGraphUtils::removeChildren(model_switch);
353-
model_switch->addChild(mt);
352+
SceneGraphUtils::removeChildren(modelNode);
353+
modelNode->addChild(mt);
354354
}
355355
}
356356
}

Diff for: examples/SimpleViewerExampleQt/src/gui/SettingsWidget.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,19 @@ SettingsWidget::SettingsWidget( IfcPlusPlusSystem* sys, ViewerWidget* vw, bool a
7171
}
7272
connect( cull_back_faces, SIGNAL( stateChanged( int ) ), this, SLOT( slotCullBackFaces( int ) ) );
7373

74-
7574
// light button
7675
QCheckBox* btn_toggle_light = new QCheckBox("Light on/off");
7776
btn_toggle_light->setToolTip("Light on/off");
78-
btn_toggle_light->setChecked(true);
77+
btn_toggle_light->setChecked(m_system->getViewController()->isSunLightOn());
7978
connect(btn_toggle_light, &QCheckBox::clicked, this, [this]() { m_system->getViewController()->toggleSunLight(); });
8079

81-
8280
// number of vertices per cycle
8381
m_spinboxCircleVertices = new QSpinBox( this );
8482
m_spinboxCircleVertices->setRange(6, 48);
8583
m_spinboxCircleVertices->setSingleStep(1);
8684
m_spinboxCircleVertices->setValue(10);
85+
m_spinboxCircleVertices->setMinimumWidth(70);
86+
m_spinboxCircleVertices->setMinimumHeight(28);
8787
if( keys.contains( "NumVerticesPerCircle" ) )
8888
{
8989
int num_vertices = settings.value("NumVerticesPerCircle").toInt();
@@ -131,7 +131,6 @@ SettingsWidget::SettingsWidget( IfcPlusPlusSystem* sys, ViewerWidget* vw, bool a
131131
}
132132
connect( m_checkShowCurveRepresentations, SIGNAL( stateChanged(int) ), this, SLOT( slotShowCurves(int) ) );
133133

134-
135134
QCheckBox* checkAutoHideFileWidget = new QCheckBox("Auto hide file open widget after file is loaded");
136135
connect(checkAutoHideFileWidget, &QCheckBox::stateChanged, this, &SettingsWidget::slotAutoHideFileWidget);
137136

Diff for: examples/SimpleViewerExampleQt/src/viewer/ViewController.cpp

+35-34
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ ViewController::ViewController( Orbit3DManipulator* camera_manip )
3939
m_camera_manip = camera_manip;
4040
m_rootnode = new osg::Group();
4141
m_rootnode->setName("m_rootnode");
42-
m_model_switch = new osg::Switch();
43-
m_rootnode->addChild( m_model_switch.get() );
42+
m_model_node = new osg::Group();
43+
m_rootnode->addChild(m_model_node.get() );
4444

4545
m_temp_node = new osg::Group();
4646
m_temp_node->setName( "m_temp_node" );
@@ -49,33 +49,6 @@ ViewController::ViewController( Orbit3DManipulator* camera_manip )
4949
m_snap_node = new osg::Group();
5050
m_snap_node->setName( "m_snap_node" );
5151
m_rootnode->addChild( m_snap_node );
52-
53-
{
54-
m_transform_light = new osg::MatrixTransform();// osg::Matrix::translate( 5, 5, 50 ) );
55-
osg::Group* light_group = new osg::Group();
56-
light_group->setName("light_group");
57-
light_group->addChild(m_transform_light);
58-
m_rootnode->addChild( light_group );
59-
60-
m_sun_light = new osg::Light();
61-
m_sun_light->setLightNum(6);
62-
m_sun_light->setPosition(osg::Vec4(0.0,0.0,0.0,1.0f));
63-
m_sun_light->setAmbient(osg::Vec4(0.5f,0.53f,0.57f,0.1f));
64-
m_sun_light->setDiffuse(osg::Vec4(0.5f,0.53f,0.57f,0.1f));
65-
m_sun_light->setSpecular( osg::Vec4( 0.5f, 0.53f, 0.57f, 0.4f ) );
66-
double model_size = 100;
67-
m_sun_light->setConstantAttenuation(1.0f);
68-
m_sun_light->setLinearAttenuation(2.0f/model_size);
69-
m_sun_light->setQuadraticAttenuation(1.0f/(model_size*model_size));
70-
71-
osg::LightSource* light_source6 = new osg::LightSource();
72-
//light_source6->setLightingMode( HEAD_LIGHT );
73-
light_source6->setReferenceFrame( osg::LightSource::ABSOLUTE_RF );
74-
light_source6->setLight(m_sun_light);
75-
light_source6->setLocalStateSetModes(osg::StateAttribute::ON);
76-
light_source6->setStateSetModes(*(m_rootnode->getOrCreateStateSet()),osg::StateAttribute::ON);
77-
m_transform_light->addChild(light_source6);
78-
}
7952

8053
m_material_default = new osg::Material();
8154
m_material_default->setAmbient( osg::Material::FRONT_AND_BACK, osg::Vec4f( 0.2f, 0.25f, 0.3f, 1.f ) );
@@ -90,7 +63,7 @@ ViewController::ViewController( Orbit3DManipulator* camera_manip )
9063
light_model->setTwoSided(true);
9164
m_rootnode->getOrCreateStateSet()->setAttribute( light_model );
9265

93-
m_stateset_default = m_model_switch->getOrCreateStateSet();
66+
m_stateset_default = m_model_node->getOrCreateStateSet();
9467
m_stateset_default->setAttribute( m_material_default, osg::StateAttribute::ON );
9568

9669
m_stateset_transparent = new osg::StateSet();
@@ -160,11 +133,11 @@ void ViewController::setModelTransparent( bool transparent )
160133
m_transparent_model = transparent;
161134
if( transparent )
162135
{
163-
m_model_switch->setStateSet( m_stateset_transparent );
136+
m_model_node->setStateSet( m_stateset_transparent );
164137
}
165138
else
166139
{
167-
m_model_switch->setStateSet( m_stateset_default );
140+
m_model_node->setStateSet( m_stateset_default );
168141
}
169142
}
170143

@@ -180,7 +153,7 @@ void ViewController::setViewerMode( ViewerMode mode )
180153
// first disable previous mode
181154
if( m_viewer_mode == VIEWER_MODE_WIREFRAME )
182155
{
183-
SceneGraphUtils::WireFrameModeOff( m_model_switch.get() );
156+
SceneGraphUtils::WireFrameModeOff(m_model_node.get() );
184157
}
185158
else if( m_viewer_mode == VIEWER_MODE_HIDDEN_LINE )
186159
{
@@ -190,7 +163,7 @@ void ViewController::setViewerMode( ViewerMode mode )
190163
m_viewer_mode = mode;
191164
if( m_viewer_mode == VIEWER_MODE_WIREFRAME )
192165
{
193-
SceneGraphUtils::WireFrameModeOn( m_model_switch.get() );
166+
SceneGraphUtils::WireFrameModeOn(m_model_node.get() );
194167
}
195168
else if( m_viewer_mode == VIEWER_MODE_HIDDEN_LINE )
196169
{
@@ -232,6 +205,34 @@ void ViewController::setSunLightOn( bool light_on )
232205
osg::StateSet* stateset_root = m_rootnode->getOrCreateStateSet();
233206
if( light_on )
234207
{
208+
if( !m_transform_light )
209+
{
210+
m_transform_light = new osg::MatrixTransform();// osg::Matrix::translate( 5, 5, 50 ) );
211+
osg::Group* light_group = new osg::Group();
212+
light_group->setName("light_group");
213+
light_group->addChild(m_transform_light);
214+
m_rootnode->addChild(light_group);
215+
216+
m_sun_light = new osg::Light();
217+
m_sun_light->setLightNum(6);
218+
m_sun_light->setPosition(osg::Vec4(0.0, 0.0, 0.0, 1.0f));
219+
m_sun_light->setAmbient(osg::Vec4(0.5f, 0.53f, 0.57f, 0.1f));
220+
m_sun_light->setDiffuse(osg::Vec4(0.5f, 0.53f, 0.57f, 0.1f));
221+
m_sun_light->setSpecular(osg::Vec4(0.5f, 0.53f, 0.57f, 0.4f));
222+
double model_size = 100;
223+
m_sun_light->setConstantAttenuation(1.0f);
224+
m_sun_light->setLinearAttenuation(2.0f / model_size);
225+
m_sun_light->setQuadraticAttenuation(1.0f / (model_size * model_size));
226+
227+
osg::LightSource* light_source6 = new osg::LightSource();
228+
//light_source6->setLightingMode( HEAD_LIGHT );
229+
light_source6->setReferenceFrame(osg::LightSource::ABSOLUTE_RF);
230+
light_source6->setLight(m_sun_light);
231+
light_source6->setLocalStateSetModes(osg::StateAttribute::ON);
232+
light_source6->setStateSetModes(*(m_rootnode->getOrCreateStateSet()), osg::StateAttribute::ON);
233+
m_transform_light->addChild(light_source6);
234+
}
235+
235236
stateset_root->setMode( GL_LIGHT6, osg::StateAttribute::ON );
236237
}
237238
else

Diff for: examples/SimpleViewerExampleQt/src/viewer/ViewController.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class ViewController
4646
~ViewController();
4747

4848
osg::Group* getRootNode() { return m_rootnode.get(); }
49-
osg::Switch* getModelNode() { return m_model_switch.get(); }
49+
osg::Group* getModelNode() { return m_model_node.get(); }
5050
osg::Group* getTempNode() { return m_temp_node.get(); }
5151
osg::Group* getSnapNode() { return m_snap_node.get(); }
5252
osg::Switch* getCoordinateAxesNode() { return m_coordinate_axes_switch.get(); }
@@ -63,6 +63,7 @@ class ViewController
6363
double getShininess() { return m_shinyness; }
6464
void toggleSunLight();
6565
void setSunLightOn( bool on );
66+
bool isSunLightOn() { return m_light_on; }
6667
void toggleModelTransparency();
6768
void setModelTransparent( bool transparent );
6869
void setViewerMode( ViewerMode mode );
@@ -89,7 +90,7 @@ class ViewController
8990
osg::ref_ptr<osg::Group> m_temp_node;
9091
osg::ref_ptr<osg::Group> m_snap_node;
9192
osg::ref_ptr<osg::Switch> m_coordinate_axes_switch;
92-
osg::ref_ptr<osg::Switch> m_model_switch;
93+
osg::ref_ptr<osg::Group> m_model_node;
9394
osg::ref_ptr<osg::MatrixTransform> m_transform_light;
9495
osg::ref_ptr<osgViewer::View> m_main_view;
9596
QtOSGWidget* m_gl_widget = nullptr;

Diff for: examples/SimpleViewerExampleQt/src/viewer/ViewerWidget.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ ViewerWidget::ViewerWidget(IfcPlusPlusSystem* sys, QWidget* parent ) : QWidget(
7676
m_stateset_selected = new osg::StateSet();
7777
m_stateset_selected->setAttribute( material_selected, osg::StateAttribute::OVERRIDE | osg::StateAttribute::ON );
7878

79-
sys->getViewController()->toggleSunLight();
80-
8179
{
8280
osg::ref_ptr<osg::Geode> geode = new osg::Geode();
8381
geode->setName( "createCoordinateAxes::geode" );

0 commit comments

Comments
 (0)