From 4d19a79ca3573aa6fd06f56c9ef880ad92984f1e Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Sun, 27 Oct 2013 14:32:47 -0200 Subject: [PATCH] 0001277: Allow to use RaySegment object in Raytracing projects --- src/Mod/Raytracing/App/LuxProject.cpp | 4 ++-- src/Mod/Raytracing/App/RayProject.cpp | 4 ++-- src/Mod/Raytracing/App/RaySegment.h | 5 +++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Mod/Raytracing/App/LuxProject.cpp b/src/Mod/Raytracing/App/LuxProject.cpp index 70a918341..c293dbbad 100644 --- a/src/Mod/Raytracing/App/LuxProject.cpp +++ b/src/Mod/Raytracing/App/LuxProject.cpp @@ -87,8 +87,8 @@ App::DocumentObjectExecReturn *LuxProject::execute(void) << "# Generated by FreeCAD (http://www.freecadweb.org/)" << endl << endl; const std::vector &Grp = Group.getValues(); for (std::vector::const_iterator It= Grp.begin();It!=Grp.end();++It) { - if ((*It)->getTypeId().isDerivedFrom(Raytracing::LuxFeature::getClassTypeId())) { - Raytracing::LuxFeature *View = dynamic_cast(*It); + if ((*It)->getTypeId().isDerivedFrom(Raytracing::RaySegment::getClassTypeId())) { + Raytracing::RaySegment *View = dynamic_cast(*It); ofile << View->Result.getValue(); ofile << endl; } diff --git a/src/Mod/Raytracing/App/RayProject.cpp b/src/Mod/Raytracing/App/RayProject.cpp index adc790389..c9401efdd 100644 --- a/src/Mod/Raytracing/App/RayProject.cpp +++ b/src/Mod/Raytracing/App/RayProject.cpp @@ -81,8 +81,8 @@ App::DocumentObjectExecReturn *RayProject::execute(void) // get through the children and collect all the views const std::vector &Grp = Group.getValues(); for (std::vector::const_iterator It= Grp.begin();It!=Grp.end();++It) { - if ((*It)->getTypeId().isDerivedFrom(Raytracing::RayFeature::getClassTypeId())) { - Raytracing::RayFeature *View = dynamic_cast(*It); + if ((*It)->getTypeId().isDerivedFrom(Raytracing::RaySegment::getClassTypeId())) { + Raytracing::RaySegment *View = dynamic_cast(*It); ofile << View->Result.getValue(); ofile << endl << endl << endl; } diff --git a/src/Mod/Raytracing/App/RaySegment.h b/src/Mod/Raytracing/App/RaySegment.h index 9aa84d592..5e3b323c0 100644 --- a/src/Mod/Raytracing/App/RaySegment.h +++ b/src/Mod/Raytracing/App/RaySegment.h @@ -54,6 +54,11 @@ public: //@{ /// recalculate the Feature virtual App::DocumentObjectExecReturn *execute(void); + + /// returns the type name of the ViewProvider + const char* getViewProviderName(void) const { + return "Gui::ViewProviderDocumentObject"; + } //@} };