44#include "FilePolyLine.hh"
49#include <OpenMesh/Core/IO/IOManager.hh>
61 return QString( tr(
"Poly-Line files ( *.pol )" ));
65 return QString( tr(
"Poly-Line files ( *.pol )" ));
73int FilePolyLinePlugin::loadObject(QString _filename)
81 std::ifstream fin(_filename.toLatin1(), std::ios::in);
83 serializer.deserialize(fin);
88 pol->setFromFileName(_filename);
89 pol->setName(QFileInfo(_filename).fileName());
92 emit openedFile( pol->id() );
97bool FilePolyLinePlugin::saveObject(
int _id, QString _filename)
105 std::cerr <<
"call Line Function\n";
106 std::cerr << (
const char*) _filename.toLatin1() << std::endl;
108 obj->setName(_filename.section(OpenFlipper::Options::dirSeparator(),-1));
109 obj->setPath(_filename.section(OpenFlipper::Options::dirSeparator(),0,-2) );
111 std::ofstream fout(_filename.toLatin1(), std::ios::out);
113 serializer.serialize(fout);
120 emit log(
LOGERR, tr(
"saveObject : cannot get object id %1 for save name %2").arg(_id).arg(_filename) );
127void FilePolyLinePlugin::loadIniFileLast(
INIFile& _ini ,
int _id ) {
130 emit log(
LOGERR,tr(
"Cannot find object for id %1 in saveFile!").arg(_id));
140 object->materialNode()->set_base_color(col);
148 emit log(
LOGERR,tr(
"Cannot find object for id %1 in saveFile!").arg(_id) );
const Vec4f & base_color() const
get the base color ( same as emission() )
MaterialNode * materialNode()
get a pointer to the materialnode
QString name() const
return the name of the object. The name defaults to NONAME if unset.
DataType supportedType()
Return your supported object type( e.g. DATA_TRIANGLE_MESH )
void saveIniFile(INIFile &_ini, int _id)
Save per object settings.
void initializePlugin()
Initialize Plugin.
Class for the handling of simple configuration files.
bool get_entryVecf(VectorT &_val, const QString &_section, const QString &_key) const
Get a Vec_n_i (int)
void add_entryVec(const QString &_section, const QString &_key, const VectorT &_value)
Addition of a Vec_n_something.
DrawMode WIREFRAME
draw wireframe
DrawMode POINTS
draw unlighted points using the default base color
bool getObject(const int _identifier, BaseObject *&_object)
Get the object which has the given identifier.
PolyLineObject * polyLineObject(BaseObjectData *_object)
Cast an BaseObject to a PolyLineObject if possible.