0001277: Allow to use RaySegment object in Raytracing projects

This commit is contained in:
Yorik van Havre 2013-10-27 14:32:47 -02:00
parent 5678247628
commit 4d19a79ca3
3 changed files with 9 additions and 4 deletions

View File

@ -87,8 +87,8 @@ App::DocumentObjectExecReturn *LuxProject::execute(void)
<< "# Generated by FreeCAD (http://www.freecadweb.org/)" << endl << endl;
const std::vector<App::DocumentObject*> &Grp = Group.getValues();
for (std::vector<App::DocumentObject*>::const_iterator It= Grp.begin();It!=Grp.end();++It) {
if ((*It)->getTypeId().isDerivedFrom(Raytracing::LuxFeature::getClassTypeId())) {
Raytracing::LuxFeature *View = dynamic_cast<Raytracing::LuxFeature *>(*It);
if ((*It)->getTypeId().isDerivedFrom(Raytracing::RaySegment::getClassTypeId())) {
Raytracing::RaySegment *View = dynamic_cast<Raytracing::RaySegment *>(*It);
ofile << View->Result.getValue();
ofile << endl;
}

View File

@ -81,8 +81,8 @@ App::DocumentObjectExecReturn *RayProject::execute(void)
// get through the children and collect all the views
const std::vector<App::DocumentObject*> &Grp = Group.getValues();
for (std::vector<App::DocumentObject*>::const_iterator It= Grp.begin();It!=Grp.end();++It) {
if ((*It)->getTypeId().isDerivedFrom(Raytracing::RayFeature::getClassTypeId())) {
Raytracing::RayFeature *View = dynamic_cast<Raytracing::RayFeature *>(*It);
if ((*It)->getTypeId().isDerivedFrom(Raytracing::RaySegment::getClassTypeId())) {
Raytracing::RaySegment *View = dynamic_cast<Raytracing::RaySegment *>(*It);
ofile << View->Result.getValue();
ofile << endl << endl << endl;
}

View File

@ -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";
}
//@}
};