Skip to content

Commit

Permalink
clean up VS project files
Browse files Browse the repository at this point in the history
  • Loading branch information
ifcquery committed Apr 30, 2024
1 parent c614aa1 commit b675b93
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 385 deletions.
11 changes: 2 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,13 @@ bin
bin32
/build/
.hg/
examples/LoadFileExampleNoGUI/LoadFileExampleNoGUI/example.ifc
examples/SimpleViewerExampleQt/dumpEntity.ifc
examples/SimpleViewerExampleQt/SimpleWall.ifc
examples/SimpleViewerExampleQt/GeneratedFiles/
examples/SimpleViewerExampleQt/dump_mesh_debug.txt
examples/SimpleViewerExampleMFC/dump_mesh_debug.txt
examples/SimpleViewerExampleMFC/x64/
examples/SimpleViewerExampleMFC/.vs/IfcQueryViewer/v15/.suo
examples/SimpleViewerExampleMFC/.vs/SimpleViewerExampleMFC/v15/.suo
examples/CreateIfcWallAndWriteFile/CreateIfcWallAndWriteFile/x64/
examples/CreateIfcWallAndWriteFile/CreateIfcWallAndWriteFile/SimpleWall.ifc
examples/CreateIfcWallAndWriteFile/SimpleWall.ifc
examples/LoadFileExampleNoGUI/LoadFileExampleNoGUI/x64/
external/Carve/build/
examples/CreateIfcWallAndWriteFile/x64/
examples/CreateIfcWallAndWriteFile/SimpleWall.ifc
examples/LoadFileWithGeometryExampleConsole/dump_mesh_debug.txt
IfcPlusPlus-*
IfcPlusPlus/src/ifcpp/geometry/Carve - Copy/
Expand All @@ -56,3 +48,4 @@ examples/SimpleViewerExampleQt/SimpleViewerExampleQt.vcxproj.user
.vs/IfcPlusPlus/v17/DocumentLayout.json
examples/SimpleViewerExampleQt/.vs/SimpleViewerExampleQt/v17/DocumentLayout.json
examples/LoadFileExample/.vs/LoadFileExample/v17/DocumentLayout.json
examples/SimpleViewerExampleQt2/
12 changes: 0 additions & 12 deletions examples/SimpleViewerExampleQt/SimpleViewerExampleQt.sln
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,13 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
ReleaseWithDebugInfo|x64 = ReleaseWithDebugInfo|x64
ReleaseWithDebugInfo|x86 = ReleaseWithDebugInfo|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B12702AD-ABFB-343A-A199-8E24837244A3}.Debug|x64.ActiveCfg = Debug|x64
{B12702AD-ABFB-343A-A199-8E24837244A3}.Debug|x64.Build.0 = Debug|x64
{B12702AD-ABFB-343A-A199-8E24837244A3}.Debug|x86.ActiveCfg = Debug|Win32
{B12702AD-ABFB-343A-A199-8E24837244A3}.Debug|x86.Build.0 = Debug|Win32
{B12702AD-ABFB-343A-A199-8E24837244A3}.Release|x64.ActiveCfg = Release|x64
{B12702AD-ABFB-343A-A199-8E24837244A3}.Release|x64.Build.0 = Release|x64
{B12702AD-ABFB-343A-A199-8E24837244A3}.Release|x86.ActiveCfg = Release|Win32
{B12702AD-ABFB-343A-A199-8E24837244A3}.Release|x86.Build.0 = Release|Win32
{B12702AD-ABFB-343A-A199-8E24837244A3}.ReleaseWithDebugInfo|x64.ActiveCfg = ReleaseWithDebugInfo|x64
{B12702AD-ABFB-343A-A199-8E24837244A3}.ReleaseWithDebugInfo|x64.Build.0 = ReleaseWithDebugInfo|x64
{B12702AD-ABFB-343A-A199-8E24837244A3}.ReleaseWithDebugInfo|x86.ActiveCfg = ReleaseWithDebugInfo|Win32
{B12702AD-ABFB-343A-A199-8E24837244A3}.ReleaseWithDebugInfo|x86.Build.0 = ReleaseWithDebugInfo|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
284 changes: 0 additions & 284 deletions examples/SimpleViewerExampleQt/SimpleViewerExampleQt.vcxproj

Large diffs are not rendered by default.

29 changes: 2 additions & 27 deletions examples/SimpleViewerExampleQt/SimpleViewerExampleQt.vcxproj.user
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,10 @@
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b$(IFCPP_DIR)\IfcPlusPlus\bin%3b$(QTDIR)\bin%3b$(OSG_DIR)\build\bin%3b$(PATH)</LocalDebuggerEnvironment>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|x64'">
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b$(IFCPP_DIR)\IfcPlusPlus\bin%3b$(QTDIR)\bin%3b$(OSG_DIR)\build\bin%3b$(PATH)</LocalDebuggerEnvironment>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b"$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b"$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'">
<LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b"$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment>
</PropertyGroup>
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<QtLastBackgroundBuild>2024-04-28T15:34:49.2973776Z</QtLastBackgroundBuild>
</PropertyGroup>
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<QtLastBackgroundBuild>2024-04-28T15:34:49.4550337Z</QtLastBackgroundBuild>
</PropertyGroup>
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<QtLastBackgroundBuild>2024-04-28T15:34:49.6528594Z</QtLastBackgroundBuild>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|Win32'" Label="QtSettings">
<QtLastBackgroundBuild>2024-04-28T15:34:48.8076472Z</QtLastBackgroundBuild>
<QtLastBackgroundBuild>2024-04-30T05:42:20.7568924Z</QtLastBackgroundBuild>
</PropertyGroup>
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<QtLastBackgroundBuild>2024-04-28T15:34:49.8299991Z</QtLastBackgroundBuild>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDebugInfo|x64'" Label="QtSettings">
<QtLastBackgroundBuild>2024-04-28T15:34:49.1260649Z</QtLastBackgroundBuild>
<QtLastBackgroundBuild>2024-04-30T05:42:20.8565894Z</QtLastBackgroundBuild>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion examples/SimpleViewerExampleQt/src/gui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ void MainWindow::slotSettingsClicked()
if (m_labelAbout->isVisible()) { m_labelAbout->hide(); }

int w = m_viewerWidget->width() - 40;
int h = 180;
int h = 250;
m_settingsWidget->setParent(m_viewerWidget);
m_settingsWidget->setGeometry(40, 0, w, h);
m_settingsWidget->setVisible(true);
Expand Down
20 changes: 10 additions & 10 deletions examples/SimpleViewerExampleQt/src/gui/OpenFileWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,8 @@ void OpenFileWidget::loadIfcFile( QString& path_in )
setEnabled(false);

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

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

if (model_switch)
if (modelNode)
{
bool optimize = true;
if (optimize)
{
osgUtil::Optimizer opt;
opt.optimize(model_switch);
opt.optimize(modelNode);
}

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

int num_children = model_switch->getNumChildren();
int num_children = modelNode->getNumChildren();
for (int i = 0; i < num_children; ++i)
{
osg::Node* node = model_switch->getChild(i);
osg::Node* node = modelNode->getChild(i);
if (!node)
{
continue;
}
mt->addChild(node);
}
SceneGraphUtils::removeChildren(model_switch);
model_switch->addChild(mt);
SceneGraphUtils::removeChildren(modelNode);
modelNode->addChild(mt);
}
}
}
Expand Down
7 changes: 3 additions & 4 deletions examples/SimpleViewerExampleQt/src/gui/SettingsWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,19 @@ SettingsWidget::SettingsWidget( IfcPlusPlusSystem* sys, ViewerWidget* vw, bool a
}
connect( cull_back_faces, SIGNAL( stateChanged( int ) ), this, SLOT( slotCullBackFaces( int ) ) );


// light button
QCheckBox* btn_toggle_light = new QCheckBox("Light on/off");
btn_toggle_light->setToolTip("Light on/off");
btn_toggle_light->setChecked(true);
btn_toggle_light->setChecked(m_system->getViewController()->isSunLightOn());
connect(btn_toggle_light, &QCheckBox::clicked, this, [this]() { m_system->getViewController()->toggleSunLight(); });


// number of vertices per cycle
m_spinboxCircleVertices = new QSpinBox( this );
m_spinboxCircleVertices->setRange(6, 48);
m_spinboxCircleVertices->setSingleStep(1);
m_spinboxCircleVertices->setValue(10);
m_spinboxCircleVertices->setMinimumWidth(70);
m_spinboxCircleVertices->setMinimumHeight(28);
if( keys.contains( "NumVerticesPerCircle" ) )
{
int num_vertices = settings.value("NumVerticesPerCircle").toInt();
Expand Down Expand Up @@ -131,7 +131,6 @@ SettingsWidget::SettingsWidget( IfcPlusPlusSystem* sys, ViewerWidget* vw, bool a
}
connect( m_checkShowCurveRepresentations, SIGNAL( stateChanged(int) ), this, SLOT( slotShowCurves(int) ) );


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

Expand Down
69 changes: 35 additions & 34 deletions examples/SimpleViewerExampleQt/src/viewer/ViewController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ ViewController::ViewController( Orbit3DManipulator* camera_manip )
m_camera_manip = camera_manip;
m_rootnode = new osg::Group();
m_rootnode->setName("m_rootnode");
m_model_switch = new osg::Switch();
m_rootnode->addChild( m_model_switch.get() );
m_model_node = new osg::Group();
m_rootnode->addChild(m_model_node.get() );

m_temp_node = new osg::Group();
m_temp_node->setName( "m_temp_node" );
Expand All @@ -49,33 +49,6 @@ ViewController::ViewController( Orbit3DManipulator* camera_manip )
m_snap_node = new osg::Group();
m_snap_node->setName( "m_snap_node" );
m_rootnode->addChild( m_snap_node );

{
m_transform_light = new osg::MatrixTransform();// osg::Matrix::translate( 5, 5, 50 ) );
osg::Group* light_group = new osg::Group();
light_group->setName("light_group");
light_group->addChild(m_transform_light);
m_rootnode->addChild( light_group );

m_sun_light = new osg::Light();
m_sun_light->setLightNum(6);
m_sun_light->setPosition(osg::Vec4(0.0,0.0,0.0,1.0f));
m_sun_light->setAmbient(osg::Vec4(0.5f,0.53f,0.57f,0.1f));
m_sun_light->setDiffuse(osg::Vec4(0.5f,0.53f,0.57f,0.1f));
m_sun_light->setSpecular( osg::Vec4( 0.5f, 0.53f, 0.57f, 0.4f ) );
double model_size = 100;
m_sun_light->setConstantAttenuation(1.0f);
m_sun_light->setLinearAttenuation(2.0f/model_size);
m_sun_light->setQuadraticAttenuation(1.0f/(model_size*model_size));

osg::LightSource* light_source6 = new osg::LightSource();
//light_source6->setLightingMode( HEAD_LIGHT );
light_source6->setReferenceFrame( osg::LightSource::ABSOLUTE_RF );
light_source6->setLight(m_sun_light);
light_source6->setLocalStateSetModes(osg::StateAttribute::ON);
light_source6->setStateSetModes(*(m_rootnode->getOrCreateStateSet()),osg::StateAttribute::ON);
m_transform_light->addChild(light_source6);
}

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

m_stateset_default = m_model_switch->getOrCreateStateSet();
m_stateset_default = m_model_node->getOrCreateStateSet();
m_stateset_default->setAttribute( m_material_default, osg::StateAttribute::ON );

m_stateset_transparent = new osg::StateSet();
Expand Down Expand Up @@ -160,11 +133,11 @@ void ViewController::setModelTransparent( bool transparent )
m_transparent_model = transparent;
if( transparent )
{
m_model_switch->setStateSet( m_stateset_transparent );
m_model_node->setStateSet( m_stateset_transparent );
}
else
{
m_model_switch->setStateSet( m_stateset_default );
m_model_node->setStateSet( m_stateset_default );
}
}

Expand All @@ -180,7 +153,7 @@ void ViewController::setViewerMode( ViewerMode mode )
// first disable previous mode
if( m_viewer_mode == VIEWER_MODE_WIREFRAME )
{
SceneGraphUtils::WireFrameModeOff( m_model_switch.get() );
SceneGraphUtils::WireFrameModeOff(m_model_node.get() );
}
else if( m_viewer_mode == VIEWER_MODE_HIDDEN_LINE )
{
Expand All @@ -190,7 +163,7 @@ void ViewController::setViewerMode( ViewerMode mode )
m_viewer_mode = mode;
if( m_viewer_mode == VIEWER_MODE_WIREFRAME )
{
SceneGraphUtils::WireFrameModeOn( m_model_switch.get() );
SceneGraphUtils::WireFrameModeOn(m_model_node.get() );
}
else if( m_viewer_mode == VIEWER_MODE_HIDDEN_LINE )
{
Expand Down Expand Up @@ -232,6 +205,34 @@ void ViewController::setSunLightOn( bool light_on )
osg::StateSet* stateset_root = m_rootnode->getOrCreateStateSet();
if( light_on )
{
if( !m_transform_light )
{
m_transform_light = new osg::MatrixTransform();// osg::Matrix::translate( 5, 5, 50 ) );
osg::Group* light_group = new osg::Group();
light_group->setName("light_group");
light_group->addChild(m_transform_light);
m_rootnode->addChild(light_group);

m_sun_light = new osg::Light();
m_sun_light->setLightNum(6);
m_sun_light->setPosition(osg::Vec4(0.0, 0.0, 0.0, 1.0f));
m_sun_light->setAmbient(osg::Vec4(0.5f, 0.53f, 0.57f, 0.1f));
m_sun_light->setDiffuse(osg::Vec4(0.5f, 0.53f, 0.57f, 0.1f));
m_sun_light->setSpecular(osg::Vec4(0.5f, 0.53f, 0.57f, 0.4f));
double model_size = 100;
m_sun_light->setConstantAttenuation(1.0f);
m_sun_light->setLinearAttenuation(2.0f / model_size);
m_sun_light->setQuadraticAttenuation(1.0f / (model_size * model_size));

osg::LightSource* light_source6 = new osg::LightSource();
//light_source6->setLightingMode( HEAD_LIGHT );
light_source6->setReferenceFrame(osg::LightSource::ABSOLUTE_RF);
light_source6->setLight(m_sun_light);
light_source6->setLocalStateSetModes(osg::StateAttribute::ON);
light_source6->setStateSetModes(*(m_rootnode->getOrCreateStateSet()), osg::StateAttribute::ON);
m_transform_light->addChild(light_source6);
}

stateset_root->setMode( GL_LIGHT6, osg::StateAttribute::ON );
}
else
Expand Down
5 changes: 3 additions & 2 deletions examples/SimpleViewerExampleQt/src/viewer/ViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ViewController
~ViewController();

osg::Group* getRootNode() { return m_rootnode.get(); }
osg::Switch* getModelNode() { return m_model_switch.get(); }
osg::Group* getModelNode() { return m_model_node.get(); }
osg::Group* getTempNode() { return m_temp_node.get(); }
osg::Group* getSnapNode() { return m_snap_node.get(); }
osg::Switch* getCoordinateAxesNode() { return m_coordinate_axes_switch.get(); }
Expand All @@ -63,6 +63,7 @@ class ViewController
double getShininess() { return m_shinyness; }
void toggleSunLight();
void setSunLightOn( bool on );
bool isSunLightOn() { return m_light_on; }
void toggleModelTransparency();
void setModelTransparent( bool transparent );
void setViewerMode( ViewerMode mode );
Expand All @@ -89,7 +90,7 @@ class ViewController
osg::ref_ptr<osg::Group> m_temp_node;
osg::ref_ptr<osg::Group> m_snap_node;
osg::ref_ptr<osg::Switch> m_coordinate_axes_switch;
osg::ref_ptr<osg::Switch> m_model_switch;
osg::ref_ptr<osg::Group> m_model_node;
osg::ref_ptr<osg::MatrixTransform> m_transform_light;
osg::ref_ptr<osgViewer::View> m_main_view;
QtOSGWidget* m_gl_widget = nullptr;
Expand Down
2 changes: 0 additions & 2 deletions examples/SimpleViewerExampleQt/src/viewer/ViewerWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ ViewerWidget::ViewerWidget(IfcPlusPlusSystem* sys, QWidget* parent ) : QWidget(
m_stateset_selected = new osg::StateSet();
m_stateset_selected->setAttribute( material_selected, osg::StateAttribute::OVERRIDE | osg::StateAttribute::ON );

sys->getViewController()->toggleSunLight();

{
osg::ref_ptr<osg::Geode> geode = new osg::Geode();
geode->setName( "createCoordinateAxes::geode" );
Expand Down

0 comments on commit b675b93

Please sign in to comment.