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