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 )" ));
73 int FilePolyLinePlugin::loadObject(QString _filename)
81 std::ifstream fin(_filename.toLatin1(), std::ios::in);
83 serializer.deserialize(fin);
89 pol->
setName(QFileInfo(_filename).fileName());
92 emit openedFile( pol->
id() );
97 bool 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) );
127 void 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) );
157 object->materialNode()->base_color() ) ;
void setPath(const QString &_path)
set the path to the object.
virtual void setName(QString _name) override
path to the file from which the object is loaded ( defaults to "." )
bool get_entryVecf(VectorT &_val, const QString &_section, const QString &_key) const
Get a Vec_n_i (int)
PolyLineObject * polyLineObject(BaseObjectData *_object)
Cast an BaseObject to a PolyLineObject if possible.
void setName(QString _name)
Set the name of the Object.
bool getObject(const int _identifier, BaseObject *&_object)
Get the object which has the given identifier.
void saveIniFile(INIFile &_ini, int _id)
Save per object settings.
DataType supportedType()
Return your supported object type( e.g. DATA_TRIANGLE_MESH )
void initializePlugin()
Initialize Plugin.
QString name() const
return the name of the object. The name defaults to NONAME if unset.
DrawMode POINTS
draw unlighted points using the default base color
void add_entryVec(const QString &_section, const QString &_key, const VectorT &_value)
Addition of a Vec_n_something.
DrawMode WIREFRAME
draw wireframe
Class for the handling of simple configuration files.
ACG::SceneGraph::PolyLineNodeT< PolyLine > * lineNode()
Get the scenegraph Node.
void setFromFileName(const QString &_filename)