45 #include "iniPlugin.hh" 61 std::vector< QString > draw_modes;
62 if( _ini.
get_entry(draw_modes, _object->
name(),
"MaterialDrawMode") )
84 std::vector< QString > draw_modes;
85 if( _ini.
get_entry(draw_modes, _object->
name(),
"MaterialDrawMode") )
106 if ( _ini.
get_entry( shininess, _object->
name() ,
"Shininess" ) )
110 if ( _ini.
get_entry( reflectance, _object->
name() ,
"Reflectance" ) ) {
114 double indexOfRefraction;
115 if ( _ini.
get_entry( indexOfRefraction, _object->
name() ,
"IndexOfRefraction" ) ) {
120 if ( _ini.
get_entry( isRefractive, _object->
name() ,
"isRefractive" ) ) {
125 if ( _ini.
get_entry( visible, _object->
name() ,
"Visible" ) ) {
166 "IndexOfRefraction" ,
184 void INIPlugin::loadIniFile(
INIFile& _ini,
int _id ) {
188 emit log(
LOGERR, tr(
"Cannot find object for id ") + QString::number(_id) + tr(
" in saveFile"));
193 parseIniFile(_ini, baseObject);
197 parseIniFileT(_ini, polyObject);
200 parseIniFileT(_ini, triObject);
203 parseIniFileT(_ini, lightObject);
206 emit log(
LOGERR, tr(
"The specified data type is not supported, yet. Aborting!"));
210 void INIPlugin::saveIniFile(
INIFile& _ini,
int _id) {
214 emit log(
LOGERR, tr(
"Cannot find object for id ") + QString::number(_id) + tr(
" in saveFile"));
219 saveIniFile(_ini, baseObject);
223 saveIniFileT(_ini, polyObject);
226 saveIniFileT(_ini, triObject);
229 saveIniFileT(_ini, lightObject);
232 emit log(
LOGERR, tr(
"The specified data type is not supported, yet. Aborting!"));
void set_diffuse_color(const Vec4f &_d)
set the diffuse color.
void set_specular_color(const Vec4f &_s)
set the specular color
const Vec4f & diffuse_color() const
get the diffuse color.
MaterialNode * materialNode()
get a pointer to the materialnode
float line_width() const
get line width
PolyMeshObject * polyMeshObject(BaseObjectData *_object)
Cast an BaseObject to a PolyMeshObject if possible.
DrawModes::DrawMode drawMode() const
Return the own draw modes of this node.
bool dataType(DataType _type) const
TriMeshObject * triMeshObject(BaseObjectData *_object)
Cast an BaseObject to a TriMeshObject if possible.
double reflectance() const
get reflectance
LightObject * lightObject(BaseObjectData *_object)
Cast an BaseObject to a LightObject if possible.
bool getObject(const int _identifier, BaseObject *&_object)
Get the object which has the given identifier.
Type for a MeshObject containing a triangle mesh.
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)
void set_line_width(float _sz)
set line width (default: 1.0)
void set_indexOfRefraction(double _m)
set index of refraction
float shininess() const
get shininess
double indexOfRefraction() const
get index of refraction
void set_overlay_color(const Vec4f &_s)
set the overlay color
const Vec4f & ambient_color() const
get the ambient color.
void set_shininess(float _s)
set shininess
const Vec4f & specular_color() const
get the specular color
void set_refractive(bool _r)
set refractive flag
void set_ambient_color(const Vec4f &_a)
set the ambient color.
void set_point_size(float _sz)
set point size (default: 1.0)
void add_entry(const QString &_section, const QString &_key, const QString &_value)
Addition / modification of a string entry.
const Vec4f & base_color() const
get the base color ( same as emission() )
float point_size() const
get point size
bool isRefractive() const
get refractive flag
void set_reflectance(double _m)
set reflectance
void add_entryVec(const QString &_section, const QString &_key, const VectorT &_value)
Addition of a Vec_n_something.
virtual bool visible()
return visiblity
#define DATA_TRIANGLE_MESH
void set_base_color(const Vec4f &_c)
set the base color ( Same as set_emission(const Vec4f& _c) )
Type for a Meshobject containing a poly mesh.
Class for the handling of simple configuration files.
const Vec4f & overlay_color() const
get the overlay color
bool get_entry(QString &_val, const QString &_section, const QString &_key) const
Access to a string entry.