50 #include "FilePolyLine.hh"
55 #include <OpenMesh/Core/IO/IOManager.hh>
59 #if QT_VERSION >= 0x050000
71 return QString( tr(
"Poly-Line files ( *.pol )" ));
75 return QString( tr(
"Poly-Line files ( *.pol )" ));
83 int FilePolyLinePlugin::loadObject(QString _filename)
91 std::ifstream fin(_filename.toLatin1(), std::ios::in);
93 serializer.deserialize(fin);
98 pol->setFromFileName(_filename);
99 pol->setName(QFileInfo(_filename).fileName());
102 emit openedFile( pol->id() );
107 bool FilePolyLinePlugin::saveObject(
int _id, QString _filename)
115 std::cerr <<
"call Line Function\n";
116 std::cerr << (
const char*) _filename.toLatin1() << std::endl;
118 obj->setName(_filename.section(OpenFlipper::Options::dirSeparator(),-1));
119 obj->setPath(_filename.section(OpenFlipper::Options::dirSeparator(),0,-2) );
121 std::ofstream fout(_filename.toLatin1(), std::ios::out);
123 serializer.serialize(fout);
130 emit log(
LOGERR, tr(
"saveObject : cannot get object id %1 for save name %2").arg(_id).arg(_filename) );
137 void FilePolyLinePlugin::loadIniFileLast(
INIFile& _ini ,
int _id ) {
140 emit log(
LOGERR,tr(
"Cannot find object for id %1 in saveFile!").arg(_id));
150 object->materialNode()->set_base_color(col);
158 emit log(
LOGERR,tr(
"Cannot find object for id %1 in saveFile!").arg(_id) );
167 object->materialNode()->base_color() ) ;
170 #if QT_VERSION < 0x050000
QString name() const
return the name of the object. The name defaults to NONAME if unset.
PolyLineObject * polyLineObject(BaseObjectData *_object)
Cast an BaseObject to a PolyLineObject if possible.
bool getObject(int _identifier, BSplineCurveObject *&_object)
void initializePlugin()
Initialize Plugin.
void add_entryVec(const QString &_section, const QString &_key, const VectorT &_value)
Addition of a Vec_n_something.
Class for the handling of simple configuration files.
DrawMode POINTS
draw unlighted points using the default base color
DataType supportedType()
Return your supported object type( e.g. DATA_TRIANGLE_MESH )
DrawMode WIREFRAME
draw wireframe
void saveIniFile(INIFile &_ini, int _id)
Save per object settings.
bool get_entryVecf(VectorT &_val, const QString &_section, const QString &_key) const
Get a Vec_n_i (int)