This is a different implementation of an annotation object which uses an SoImage node instead of an SoText2 or SoAsciiText node. More...
#include <ViewProviderAnnotation.h>
Public Member Functions | |
void | attach (App::DocumentObject *) |
std::vector< std::string > | getDisplayModes (void) const |
Return a list of all possible modes. | |
virtual Base::Type | getTypeId (void) const |
void | setDisplayMode (const char *ModeName) |
set the display mode | |
void | updateData (const App::Property *) |
Gets called if some of the property hade bin changed. | |
ViewProviderAnnotationLabel (void) | |
Constructor. | |
virtual | ~ViewProviderAnnotationLabel () |
Static Public Member Functions | |
static void * | create (void) |
static Base::Type | getClassTypeId (void) |
static void | init (void) |
Public Attributes | |
App::PropertyColor | BackgroundColor |
App::PropertyFont | FontName |
App::PropertyFloat | FontSize |
App::PropertyBool | Frame |
App::PropertyEnumeration | Justification |
App::PropertyColor | TextColor |
Protected Member Functions | |
void | drawImage (const std::vector< std::string > &) |
virtual const App::PropertyData & | getPropertyData (void) const |
void | onChanged (const App::Property *prop) |
Gets called by the container whenever a property has been changed. | |
Static Protected Member Functions | |
static const App::PropertyData * | getPropertyDataPtr (void) |
Edit methods | |
| |
bool | doubleClicked (void) |
is called by the tree if the user double click on the object | |
void | setupContextMenu (QMenu *, QObject *, const char *) |
set up the context-menu with the supported edit modes | |
bool | setEdit (int ModNum) |
is called by the document when the provider goes in edit mode | |
void | unsetEdit (int ModNum) |
is called when you loose the edit mode |
This is a different implementation of an annotation object which uses an SoImage node instead of an SoText2 or SoAsciiText node.
This approach gives a bit more flexibility since it can render arbitrary annotations.
Definition at line 87 of file ViewProviderAnnotation.h.
ViewProviderAnnotationLabel::ViewProviderAnnotationLabel | ( | void | ) |
Constructor.
Definition at line 242 of file ViewProviderAnnotation.cpp.
References ADD_PROPERTY, and SketcherExample::f.
ViewProviderAnnotationLabel::~ViewProviderAnnotationLabel | ( | ) | [virtual] |
Definition at line 269 of file ViewProviderAnnotation.cpp.
void ViewProviderAnnotationLabel::attach | ( | App::DocumentObject * | f | ) | [virtual] |
Reimplemented from Gui::ViewProviderDocumentObject.
Definition at line 317 of file ViewProviderAnnotation.cpp.
References Gui::ViewProvider::addDisplayMaskMode().
void * Gui::ViewProviderAnnotationLabel::create | ( | void | ) | [static] |
Reimplemented from Gui::ViewProviderDocumentObject.
Definition at line 239 of file ViewProviderAnnotation.cpp.
bool ViewProviderAnnotationLabel::doubleClicked | ( | void | ) | [virtual] |
is called by the tree if the user double click on the object
Reimplemented from Gui::ViewProvider.
Definition at line 364 of file ViewProviderAnnotation.cpp.
References Gui::Application::activeDocument(), Gui::Application::Instance, and Gui::Document::setEdit().
void ViewProviderAnnotationLabel::drawImage | ( | const std::vector< std::string > & | s | ) | [protected] |
Definition at line 434 of file ViewProviderAnnotation.cpp.
References App::Color::b, FemExample::b, BackgroundColor, Gui::BitmapFactory(), Gui::BitmapFactoryInst::convert(), FontName, FontSize, Frame, App::Color::g, App::PropertyInteger::getValue(), App::PropertyBool::getValue(), App::PropertyColor::getValue(), App::PropertyFloat::getValue(), App::PropertyString::getValue(), Gui::ViewProviderDocumentObject::hide(), Justification, App::Color::r, RobotExample::t, TextColor, and RobotExample::w.
Referenced by onChanged(), and updateData().
Base::Type Gui::ViewProviderAnnotationLabel::getClassTypeId | ( | void | ) | [static] |
Reimplemented from Gui::ViewProviderDocumentObject.
Definition at line 239 of file ViewProviderAnnotation.cpp.
Referenced by onChanged(), and updateData().
std::vector< std::string > ViewProviderAnnotationLabel::getDisplayModes | ( | void | ) | const [virtual] |
Return a list of all possible modes.
Reimplemented from Gui::ViewProviderDocumentObject.
Definition at line 298 of file ViewProviderAnnotation.cpp.
const App::PropertyData & Gui::ViewProviderAnnotationLabel::getPropertyData | ( | void | ) | const [protected, virtual] |
Reimplemented from Gui::ViewProviderDocumentObject.
Definition at line 239 of file ViewProviderAnnotation.cpp.
const App::PropertyData * Gui::ViewProviderAnnotationLabel::getPropertyDataPtr | ( | void | ) | [static, protected] |
Reimplemented from Gui::ViewProviderDocumentObject.
Definition at line 239 of file ViewProviderAnnotation.cpp.
Base::Type Gui::ViewProviderAnnotationLabel::getTypeId | ( | void | ) | const [virtual] |
Reimplemented from Gui::ViewProviderDocumentObject.
Definition at line 239 of file ViewProviderAnnotation.cpp.
void Gui::ViewProviderAnnotationLabel::init | ( | void | ) | [static] |
Reimplemented from Gui::ViewProviderDocumentObject.
Definition at line 239 of file ViewProviderAnnotation.cpp.
Referenced by Gui::Application::initTypes().
void ViewProviderAnnotationLabel::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 278 of file ViewProviderAnnotation.cpp.
References App::Color::b, BackgroundColor, drawImage(), FontName, FontSize, Frame, App::Color::g, getClassTypeId(), Gui::ViewProviderDocumentObject::getObject(), App::PropertyContainer::getPropertyByName(), App::Property::getTypeId(), App::PropertyColor::getValue(), Justification, App::Color::r, and TextColor.
void ViewProviderAnnotationLabel::setDisplayMode | ( | const char * | ModeName | ) | [virtual] |
set the display mode
If you add new viewing modes in getDisplayModes() then you need to reimplement also seDisplaytMode() to handle these new modes by setting the appropriate display mode.
Reimplemented from Gui::ViewProvider.
Definition at line 307 of file ViewProviderAnnotation.cpp.
References Gui::ViewProvider::setDisplayMaskMode().
bool ViewProviderAnnotationLabel::setEdit | ( | int | ModNum | ) | [protected, virtual] |
is called by the document when the provider goes in edit mode
Reimplemented from Gui::ViewProvider.
Definition at line 397 of file ViewProviderAnnotation.cpp.
References Gui::ViewProvider::pcRoot.
void ViewProviderAnnotationLabel::setupContextMenu | ( | QMenu * | , | |
QObject * | , | |||
const char * | ||||
) | [virtual] |
set up the context-menu with the supported edit modes
Reimplemented from Gui::ViewProvider.
Definition at line 370 of file ViewProviderAnnotation.cpp.
void ViewProviderAnnotationLabel::unsetEdit | ( | int | ModNum | ) | [protected, virtual] |
is called when you loose the edit mode
Reimplemented from Gui::ViewProvider.
Definition at line 417 of file ViewProviderAnnotation.cpp.
References Gui::ViewProvider::pcRoot.
void ViewProviderAnnotationLabel::updateData | ( | const App::Property * | ) | [virtual] |
Gets called if some of the property hade bin changed.
Reimplemented from Gui::ViewProviderDocumentObject.
Definition at line 343 of file ViewProviderAnnotation.cpp.
References drawImage(), getClassTypeId(), App::Property::getName(), App::Property::getTypeId(), Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
Definition at line 98 of file ViewProviderAnnotation.h.
Referenced by drawImage(), and onChanged().
Definition at line 101 of file ViewProviderAnnotation.h.
Referenced by drawImage(), and onChanged().
Definition at line 100 of file ViewProviderAnnotation.h.
Referenced by drawImage(), and onChanged().
Definition at line 102 of file ViewProviderAnnotation.h.
Referenced by drawImage(), and onChanged().
Definition at line 99 of file ViewProviderAnnotation.h.
Referenced by drawImage(), and onChanged().
Definition at line 97 of file ViewProviderAnnotation.h.
Referenced by drawImage(), and onChanged().