56 return QString( tr(
"Plane files ( *.pla )") );
60 return QString( tr(
"Plane files ( *.pla )") );
68 int FilePlaPlugin::loadObject(QString _filename)
79 QFileInfo fi(_filename);
87 QSettings settings(_filename, QSettings::IniFormat);
88 settings.beginGroup(
"PLANE");
90 if ( settings.contains(
"Position0") ){
92 position[0] = settings.value(
"Position0").toDouble();
93 position[1] = settings.value(
"Position1").toDouble();
94 position[2] = settings.value(
"Position2").toDouble();
95 xDirection[0] = settings.value(
"XDirection0").toDouble();
96 xDirection[1] = settings.value(
"XDirection1").toDouble();
97 xDirection[2] = settings.value(
"XDirection2").toDouble();
98 yDirection[0] = settings.value(
"YDirection0").toDouble();
99 yDirection[1] = settings.value(
"YDirection1").toDouble();
100 yDirection[2] = settings.value(
"YDirection2").toDouble();
103 plane->plane().
setPlane(position, xDirection, yDirection);
118 bool FilePlaPlugin::saveObject(
int _id, QString _filename)
131 QSettings settings(_filename, QSettings::IniFormat);
132 settings.beginGroup(
"PLANE");
145 emit log(
LOGERR, tr(
"saveObject : cannot get object id %1 for save name %2").arg(_id).arg(_filename) );
virtual void setName(QString _name) override
path to the file from which the object is loaded ( defaults to "." )
const UpdateType UPDATE_ALL(UpdateTypeSet(1))
Identifier for all updates.
void initializePlugin()
Initialize Plugin.
ACG::Vec3d yDirection()
local y direction (multiplied with height)
bool getObject(const int _identifier, BaseObject *&_object)
Get the object which has the given identifier.
PlaneNode * planeNode()
Get the scenegraph Node.
ACG::Vec3d xDirection()
local x direction (multiplied with width)
QString filename() const
return the filename of the object
void setPlane(const ACG::Vec3d &_position, const ACG::Vec3d &_xDirection, const ACG::Vec3d &)
Set plane.
ACG::Vec3d position()
get center position of the plane
PlaneObject * planeObject(BaseObjectData *_object)
Cast an BaseObject to a PlaneObject if possible.
DataType supportedType()
Return your supported object type( e.g. DATA_TRIANGLE_MESH )
void setFromFileName(const QString &_filename)