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