The ViewProviderMeshCurvature class is associated to the mesh curvature feature. More...
#include <ViewProviderCurvature.h>
Public Member Functions | |
void | attach (App::DocumentObject *pcFeature) |
Extracts the mesh data from the feature pcFeature and creates an Inventor node SoNode with these data. | |
virtual const char * | getDefaultDisplayMode () const |
get the default display mode | |
std::vector< std::string > | getDisplayModes (void) const |
Returns a list of all possible modes. | |
SoSeparator * | getFrontRoot (void) const |
Returns a color bar. | |
QIcon | getIcon () const |
Returns a pixmap for the associated feature type. | |
virtual Base::Type | getTypeId (void) const |
virtual void | hide (void) |
Hide the object in the view. | |
void | OnChange (Base::Subject< int > &rCaller, int rcReason) |
Once the color bar settinhs has been changed this method gets called to update the feature's representation. | |
void | setDisplayMode (const char *ModeName) |
Sets the viewing mode. | |
virtual void | show (void) |
Show the object in the view. | |
void | updateData (const App::Property *) |
Updates the mesh feature representation. | |
ViewProviderMeshCurvature () | |
virtual | ~ViewProviderMeshCurvature () |
Static Public Member Functions | |
static void * | create (void) |
static void | curvatureInfoCallback (void *ud, SoEventCallback *n) |
static Base::Type | getClassTypeId (void) |
static void | init (void) |
Public Attributes | |
App::PropertyMaterial | TextureMaterial |
Protected Member Functions | |
std::string | curvatureInfo (bool detail, int index1, int index2, int index3) const |
virtual const App::PropertyData & | getPropertyData (void) const |
void | onChanged (const App::Property *prop) |
Gets called by the container whenever a property has been changed. | |
void | setVertexCurvatureMode (int mode) |
Static Protected Member Functions | |
static const App::PropertyData * | getPropertyDataPtr (void) |
Protected Attributes | |
Gui::SoFCColorBar * | pcColorBar |
SoMaterial * | pcColorMat |
SoSeparator * | pcColorRoot |
SoDrawStyle * | pcColorStyle |
SoGroup * | pcLinkRoot |
The ViewProviderMeshCurvature class is associated to the mesh curvature feature.
It allows to display the most known types of curvatures, such as Gaussian curvature, mean curvature, minimum and maximum curvature. Moreover a color bar is also added to the scene.
Definition at line 58 of file ViewProviderCurvature.h.
ViewProviderMeshCurvature::ViewProviderMeshCurvature | ( | ) |
Definition at line 87 of file ViewProviderCurvature.cpp.
References ADD_PROPERTY, App::Material::ambientColor, App::Material::diffuseColor, App::Material::emissiveColor, SketcherExample::f, App::Material::shininess, App::Material::specularColor, and App::Material::transparency.
ViewProviderMeshCurvature::~ViewProviderMeshCurvature | ( | ) | [virtual] |
Definition at line 133 of file ViewProviderCurvature.cpp.
References Base::Subject< _MessageType >::Detach(), pcColorBar, pcColorMat, pcColorRoot, and pcLinkRoot.
void ViewProviderMeshCurvature::attach | ( | App::DocumentObject * | pcFeature | ) | [virtual] |
Extracts the mesh data from the feature pcFeature and creates an Inventor node SoNode with these data.
Reimplemented from Gui::ViewProviderDocumentObject.
Definition at line 258 of file ViewProviderCurvature.cpp.
References Gui::ViewProvider::addDisplayMaskMode(), Base::Subject< _MessageType >::Attach(), Gui::ViewProviderDocumentObject::attach(), App::DocumentObserver::attachDocument(), Base::Subject< _MessageType >::Detach(), Gui::ViewProviderDocumentObject::findFrontRootOfType(), App::DocumentObject::getDocument(), Gui::SoFCColorBar::getMaxValue(), Gui::SoFCColorBar::getMinValue(), Base::Subject< _MessageType >::Notify(), pcColorBar, pcColorMat, pcColorRoot, pcLinkRoot, and Gui::SoFCColorBar::setRange().
void * MeshGui::ViewProviderMeshCurvature::create | ( | void | ) | [static] |
Reimplemented from Gui::ViewProviderDocumentObject.
Definition at line 85 of file ViewProviderCurvature.cpp.
std::string ViewProviderMeshCurvature::curvatureInfo | ( | bool | detail, | |
int | index1, | |||
int | index2, | |||
int | index3 | |||
) | const [protected] |
Definition at line 603 of file ViewProviderCurvature.cpp.
References Mesh::CurvatureInfo::fMaxCurvature, Mesh::CurvatureInfo::fMinCurvature, Gui::ViewProvider::getActiveDisplayMode(), getClassTypeId(), App::PropertyContainer::getPropertyByName(), App::Property::getTypeId(), and Gui::ViewProviderDocumentObject::pcObject.
Referenced by curvatureInfoCallback().
void ViewProviderMeshCurvature::curvatureInfoCallback | ( | void * | ud, | |
SoEventCallback * | n | |||
) | [static] |
Definition at line 511 of file ViewProviderCurvature.cpp.
References Base::Console(), curvatureInfo(), getClassTypeId(), Gui::getMainWindow(), Gui::ViewProvider::getTypeId(), Gui::View3DInventorViewer::getViewProviderByPath(), Base::Type::isDerivedFrom(), RobotExample::pos, Gui::View3DInventorViewer::removeEventCallback(), MeshGui::Annotation::run(), Gui::View3DInventorViewer::setEditing(), Gui::View3DInventorViewer::setRedirectToSceneGraph(), and Gui::ToolTip::showText().
Referenced by CmdMeshVertexCurvatureInfo::activated().
Base::Type MeshGui::ViewProviderMeshCurvature::getClassTypeId | ( | void | ) | [static] |
Reimplemented from Gui::ViewProviderDocumentObject.
Definition at line 85 of file ViewProviderCurvature.cpp.
Referenced by curvatureInfo(), curvatureInfoCallback(), and updateData().
const char * ViewProviderMeshCurvature::getDefaultDisplayMode | ( | ) | const [virtual] |
get the default display mode
Reimplemented from Gui::ViewProviderDocumentObject.
Definition at line 423 of file ViewProviderCurvature.cpp.
std::vector< std::string > ViewProviderMeshCurvature::getDisplayModes | ( | void | ) | const [virtual] |
Returns a list of all possible modes.
Reimplemented from Gui::ViewProviderDocumentObject.
Definition at line 428 of file ViewProviderCurvature.cpp.
References Gui::ViewProviderDocumentObject::getDisplayModes().
SoSeparator * ViewProviderMeshCurvature::getFrontRoot | ( | void | ) | const [virtual] |
Returns a color bar.
Reimplemented from Gui::ViewProvider.
Definition at line 331 of file ViewProviderCurvature.cpp.
References pcColorRoot.
QIcon ViewProviderMeshCurvature::getIcon | ( | void | ) | const [virtual] |
Returns a pixmap for the associated feature type.
Reimplemented from Gui::ViewProvider.
Definition at line 366 of file ViewProviderCurvature.cpp.
References px.
const App::PropertyData & MeshGui::ViewProviderMeshCurvature::getPropertyData | ( | void | ) | const [protected, virtual] |
Reimplemented from Gui::ViewProviderDocumentObject.
Definition at line 85 of file ViewProviderCurvature.cpp.
const App::PropertyData * MeshGui::ViewProviderMeshCurvature::getPropertyDataPtr | ( | void | ) | [static, protected] |
Reimplemented from Gui::ViewProviderDocumentObject.
Definition at line 85 of file ViewProviderCurvature.cpp.
Base::Type MeshGui::ViewProviderMeshCurvature::getTypeId | ( | void | ) | const [virtual] |
Reimplemented from Gui::ViewProviderDocumentObject.
Definition at line 85 of file ViewProviderCurvature.cpp.
void ViewProviderMeshCurvature::hide | ( | void | ) | [virtual] |
Hide the object in the view.
Reimplemented from Gui::ViewProviderDocumentObject.
Definition at line 156 of file ViewProviderCurvature.cpp.
References Gui::ViewProviderDocumentObject::hide(), and pcColorStyle.
void MeshGui::ViewProviderMeshCurvature::init | ( | void | ) | [static] |
Reimplemented from Gui::ViewProviderDocumentObject.
Definition at line 85 of file ViewProviderCurvature.cpp.
Referenced by initMeshGui(), and updateData().
void ViewProviderMeshCurvature::OnChange | ( | Base::Subject< int > & | rCaller, | |
int | rcReason | |||
) | [virtual] |
Once the color bar settinhs has been changed this method gets called to update the feature's representation.
Implements Base::Observer< int >.
Definition at line 442 of file ViewProviderCurvature.cpp.
References Gui::ViewProviderDocumentObject::setActiveMode().
void ViewProviderMeshCurvature::onChanged | ( | const App::Property * | prop | ) | [protected, virtual] |
Gets called by the container whenever a property has been changed.
Reimplemented from Gui::ViewProviderDocumentObject.
Definition at line 142 of file ViewProviderCurvature.cpp.
References App::Material::ambientColor, App::Material::emissiveColor, App::PropertyMaterial::getValue(), pcColorMat, App::Material::shininess, App::Material::specularColor, TextureMaterial, and App::Material::transparency.
void ViewProviderMeshCurvature::setDisplayMode | ( | const char * | ModeName | ) | [virtual] |
Sets the viewing mode.
Reimplemented from Gui::ViewProvider.
Definition at line 397 of file ViewProviderCurvature.cpp.
References Mesh::PropertyCurvatureList::AbsCurvature, Mesh::PropertyCurvatureList::GaussCurvature, Mesh::PropertyCurvatureList::MaxCurvature, Mesh::PropertyCurvatureList::MeanCurvature, Mesh::PropertyCurvatureList::MinCurvature, Gui::ViewProvider::setDisplayMaskMode(), Gui::ViewProvider::setDisplayMode(), and setVertexCurvatureMode().
void ViewProviderMeshCurvature::setVertexCurvatureMode | ( | int | mode | ) | [protected] |
Definition at line 336 of file ViewProviderCurvature.cpp.
References App::Color::b, SketcherExample::f, App::Color::g, Mesh::PropertyCurvatureList::getClassTypeId(), Gui::SoFCColorBar::getColor(), Mesh::PropertyCurvatureList::getCurvature(), App::PropertyContainer::getPropertyMap(), Gui::SoFCColorBar::isVisible(), pcColorBar, pcColorMat, Gui::ViewProviderDocumentObject::pcObject, App::Color::r, and RobotExample::t.
Referenced by setDisplayMode().
void ViewProviderMeshCurvature::show | ( | void | ) | [virtual] |
Show the object in the view.
Reimplemented from Gui::ViewProviderDocumentObject.
Definition at line 162 of file ViewProviderCurvature.cpp.
References pcColorStyle, and Gui::ViewProviderDocumentObject::show().
void ViewProviderMeshCurvature::updateData | ( | const App::Property * | prop | ) | [virtual] |
Updates the mesh feature representation.
Reimplemented from Gui::ViewProviderDocumentObject.
Definition at line 303 of file ViewProviderCurvature.cpp.
References Mesh::MeshObject::countPoints(), getClassTypeId(), App::DocumentObject::getDocument(), Gui::ViewProviderGeometryObject::getHighlightNode(), Mesh::PropertyCurvatureList::getSize(), App::Property::getTypeId(), Gui::Document::getViewProvider(), init(), Gui::Application::Instance, pcColorMat, pcLinkRoot, Gui::ViewProviderDocumentObject::pcObject, and Gui::ViewProviderDocumentObject::setActiveMode().
Definition at line 117 of file ViewProviderCurvature.h.
Referenced by attach(), setVertexCurvatureMode(), and ~ViewProviderMeshCurvature().
SoMaterial* MeshGui::ViewProviderMeshCurvature::pcColorMat [protected] |
Definition at line 115 of file ViewProviderCurvature.h.
Referenced by attach(), onChanged(), setVertexCurvatureMode(), updateData(), and ~ViewProviderMeshCurvature().
SoSeparator* MeshGui::ViewProviderMeshCurvature::pcColorRoot [protected] |
Definition at line 119 of file ViewProviderCurvature.h.
Referenced by attach(), getFrontRoot(), and ~ViewProviderMeshCurvature().
SoDrawStyle* MeshGui::ViewProviderMeshCurvature::pcColorStyle [protected] |
Definition at line 118 of file ViewProviderCurvature.h.
SoGroup* MeshGui::ViewProviderMeshCurvature::pcLinkRoot [protected] |
Definition at line 116 of file ViewProviderCurvature.h.
Referenced by attach(), updateData(), and ~ViewProviderMeshCurvature().
Definition at line 69 of file ViewProviderCurvature.h.
Referenced by onChanged().