51 #include "TypeTriangleMesh.hh" 53 #include <OpenFlipper/common/BackupData.hh> 54 #include "TriMeshBackup.hh" 59 TypeTriangleMeshPlugin::TypeTriangleMeshPlugin() {
65 bool TypeTriangleMeshPlugin::registerType() {
91 QString
name = QString(tr(
"TriangleMesh new %1.off").arg( object->
id() ));
95 object->setName( f.fileName() );
98 const QColor color = OpenFlipper::Options::defaultColor();
99 const ACG::Vec4f default_color(color.redF(), color.greenF(), color.blueF(), color.alphaF());
100 object->materialNode()->set_color(default_color);
106 emit emptyObjectAdded (object->
id() );
126 backupData = dynamic_cast< BackupData* >(object->
objectData(OBJECT_BACKUPS));
130 object->setObjectData(OBJECT_BACKUPS, backupData);
142 #if QT_VERSION < 0x050000 DLLEXPORT DataType typeId(QString _name)
Given a dataType Identifier string this function will return the id of the datatype.
Type for a MeshObject containing a triangle mesh.
QString name()
Return a name for the plugin.
bool getObject(int _identifier, BSplineCurveObject *&_object)
Abstract class that is used to store backups.
DLLEXPORT OpenFlipperQSettings & OpenFlipperSettings()
QSettings object containing all program settings of OpenFlipper.
Class that encapsulates a backup.
DLLEXPORT DataType addDataType(QString _name, QString _readableName)
Adds a datatype and returns the id for the new type.
int objectCount()
Get the number of available objects.
void storeBackup(BaseBackup *_backup)
store a backup
bool hasObjectData(QString _dataName)
Checks if object data with given name is available.
TriMeshObject * triMeshObject(BaseObjectData *_object)
Cast an BaseObject to a TriMeshObject if possible.
DLLEXPORT void setTypeIcon(DataType _id, QString _icon)
Set an Icon for a given DataType.
int targetCount()
Get the number of target objects.
int addEmpty()
Create an empty object.
void generateBackup(int _id, QString _name, UpdateType _type)
This slot should be implemented in a TypePlugin to generate type specific backups.
PerObjectData * objectData(QString _dataName)
Returns the object data pointer.