5#ifndef DCPP_I_COLLADA_MESH_WRITER_HPP_INCLUDED 
    6#define DCPP_I_COLLADA_MESH_WRITER_HPP_INCLUDED 
    8#include <duckcpp/core/engine/IMeshWriter.hpp> 
    9#include <duckcpp/core/engine/ISceneNode.hpp> 
   10#include <duckcpp/core/engine/IAnimatedMesh.hpp> 
   11#include <duckcpp/core/engine/SMaterial.hpp> 
  207            : Properties(0), DefaultProperties(0), NameGenerator(0), DefaultNameGenerator(0)
 
  208            , WriteTextures(
true), WriteDefaultScene(
true), ExportSMaterialOnce(
true)
 
  209            , AmbientLight(0.f, 0.f, 0.f, 1.f)
 
  210            , UnitMeter(1.f), UnitName(
"meter")
 
  213            ParamNamesUV[0] = 
"U";
 
  214            ParamNamesUV[1] = 
"V";
 
  222            if ( DefaultProperties )
 
  223                DefaultProperties->
drop();
 
  225                NameGenerator->
drop();
 
  226            if ( DefaultNameGenerator )
 
  227                DefaultNameGenerator->
drop();
 
 
  238            WriteTextures = write;
 
 
  244            return WriteTextures;
 
 
  254            WriteDefaultScene = write;
 
 
  260            return WriteDefaultScene;
 
 
  266            AmbientLight = ambientColor;
 
 
  307            GeometryWriting = writeStyle;
 
 
  313            return GeometryWriting;
 
 
  326            ExportSMaterialOnce = exportOnce;
 
 
  329        virtual bool getExportSMaterialsOnlyOnce()
 const 
  331            return ExportSMaterialOnce;
 
  339            if ( p == Properties )
 
 
  358            return DefaultProperties;
 
 
  364            if ( nameGenerator == NameGenerator )
 
  367                nameGenerator->
grab();
 
  369                NameGenerator->
drop();
 
  370            NameGenerator = nameGenerator;
 
 
  376            return NameGenerator;
 
 
  383            return DefaultNameGenerator;
 
 
  414            if ( p == DefaultProperties )
 
  418            if ( DefaultProperties )
 
  419                DefaultProperties->
drop();
 
  420            DefaultProperties = p;
 
  424        virtual void setDefaultNameGenerator(IColladaMeshWriterNames * p)
 
  426            if ( p == DefaultNameGenerator )
 
  430            if ( DefaultNameGenerator )
 
  431                DefaultNameGenerator->
drop();
 
  432            DefaultNameGenerator = p;
 
  439        IColladaMeshWriterProperties * Properties;
 
  440        IColladaMeshWriterProperties * DefaultProperties;
 
  441        IColladaMeshWriterNames * NameGenerator;
 
  442        IColladaMeshWriterNames * DefaultNameGenerator;
 
  444        bool WriteDefaultScene;
 
  445        bool ExportSMaterialOnce;
 
 
Base class of most objects of the Duckcpp Engine.
Definition IReferenceCounted.hpp:46
 
bool drop() const
Drops the object. Decrements the reference counter by one.
Definition IReferenceCounted.hpp:126
 
void grab() const
Grabs the object. Increments the reference counter by one.
Definition IReferenceCounted.hpp:96
 
Interface providing write access to a file.
Definition IWriteFile.hpp:18
 
Callback interface to use custom names on collada writing.
Definition IColladaMeshWriter.hpp:160
 
virtual dcpp::nub::string nameForNode(const dcpp::scene::ISceneNode *node)=0
Return a unique name for the given node.
 
virtual dcpp::nub::string nameForMesh(const dcpp::scene::IMesh *mesh, int instance)=0
Return a unique name for the given mesh.
 
virtual dcpp::nub::string nameForMaterial(const dcpp::video::SMaterial &material, int materialId, const dcpp::scene::IMesh *mesh, const dcpp::scene::ISceneNode *node)=0
Return a name for the material.
 
Callback interface for properties which can be used to influence collada writing.
Definition IColladaMeshWriter.hpp:93
 
virtual E_COLLADA_TECHNIQUE_FX getTechniqueFx(const dcpp::video::SMaterial &material) const =0
Which lighting model should be used in the technique (FX) section when exporting effects (materials)
 
virtual E_COLLADA_TRANSPARENT_FX getTransparentFx(const dcpp::video::SMaterial &material) const =0
Return the transparence color interpretation.
 
virtual bool isExportable(const dcpp::scene::ISceneNode *node) const =0
 
virtual dcpp::int32_kt getTextureIdx(const dcpp::video::SMaterial &material, E_COLLADA_COLOR_SAMPLER cs) const =0
Which texture index should be used when writing the texture of the given sampler color.
 
virtual IMesh * getMesh(dcpp::scene::ISceneNode *node)=0
 
virtual E_COLLADA_DCPP_COLOR getColorMapping(const dcpp::video::SMaterial &material, E_COLLADA_COLOR_SAMPLER cs) const =0
Return which color from Duckcpp should be used for the color requested by collada.
 
virtual dcpp::video::SColor getCustomColor(const dcpp::video::SMaterial &material, E_COLLADA_COLOR_SAMPLER cs) const =0
Return custom colors for certain color types requested by collada.
 
virtual dcpp::float32_kt getIndexOfRefraction(const dcpp::video::SMaterial &material) const =0
Return index of refraction for that material.
 
virtual dcpp::float32_kt getReflectivity(const dcpp::video::SMaterial &material) const =0
Reflectivity value for that material.
 
virtual bool useNodeMaterial(const dcpp::scene::ISceneNode *node) const =0
Return if the node has it's own material overwriting the mesh-materials.
 
virtual dcpp::float32_kt getTransparency(const dcpp::video::SMaterial &material) const =0
Transparency value for that material.
 
Interface for writing meshes.
Definition IColladaMeshWriter.hpp:203
 
virtual void setProperties(IColladaMeshWriterProperties *p)
Set properties to use by the meshwriter instead of it's default properties.
Definition IColladaMeshWriter.hpp:337
 
virtual ~IColladaMeshWriter()
Destructor.
Definition IColladaMeshWriter.hpp:218
 
virtual dcpp::nub::string getUnitName() const
Return name to use for distance units. Like p.E. "meter".
Definition IColladaMeshWriter.hpp:292
 
void SetParamNamesUV(const dcpp::nub::string &u, const dcpp::nub::string &v)
Change param name used for UV's.
Definition IColladaMeshWriter.hpp:403
 
IColladaMeshWriterNames * getDefaultNameGenerator() const
Return the original default name generator of the writer.
Definition IColladaMeshWriter.hpp:381
 
virtual void setExportSMaterialsOnlyOnce(bool exportOnce)
Make certain there is only one collada material generated per Duckcpp material.
Definition IColladaMeshWriter.hpp:324
 
IColladaMeshWriterProperties * getDefaultProperties() const
Return the original default properties of the writer.
Definition IColladaMeshWriter.hpp:356
 
virtual void setAmbientLight(const dcpp::video::SColorf &ambientColor)
Sets ambient color of the scene to write.
Definition IColladaMeshWriter.hpp:264
 
virtual void setGeometryWriting(E_COLLADA_GEOMETRY_WRITING writeStyle)
Control when and how often a mesh is written.
Definition IColladaMeshWriter.hpp:305
 
virtual E_COLLADA_GEOMETRY_WRITING getGeometryWriting() const
Get the current style of geometry writing.
Definition IColladaMeshWriter.hpp:311
 
virtual IColladaMeshWriterNames * getNameGenerator() const
Get currently used name generator.
Definition IColladaMeshWriter.hpp:374
 
virtual void setUnit(dcpp::float32_kt meter, const dcpp::nub::string &name)
Set the unit distances for all elements and objects.
Definition IColladaMeshWriter.hpp:279
 
virtual bool getWriteTextures() const
Get if texture information should be written.
Definition IColladaMeshWriter.hpp:242
 
virtual void setWriteDefaultScene(bool write)
Set if a default scene should be written when writing meshes.
Definition IColladaMeshWriter.hpp:252
 
virtual bool writeScene(dcpp::io::IWriteFile *file, dcpp::scene::ISceneNode *root, int writeRoot=1)=0
writes a scene starting with the given node
 
virtual void setWriteTextures(bool write)
Set if texture information should be written.
Definition IColladaMeshWriter.hpp:236
 
virtual const dcpp::nub::string * findGeometryNameForNode(ISceneNode *node)=0
After export you can find out which name had been used for writing the geometry for this node.
 
virtual dcpp::nub::string toNCName(const dcpp::nub::string &oldString, const dcpp::nub::string &prefix=dcpp::nub::string("_NC_")) const =0
Restrict the characters of oldString a set of allowed characters in xs:NCName and add the prefix.
 
virtual IColladaMeshWriterProperties * getProperties() const
Get properties which are currently used.
Definition IColladaMeshWriter.hpp:349
 
virtual dcpp::float32_kt getUnitMeter() const
Return real world meters to use per unit for all elements and objects.
Definition IColladaMeshWriter.hpp:286
 
virtual bool getWriteDefaultScene() const
Get if a default scene should be written.
Definition IColladaMeshWriter.hpp:258
 
virtual dcpp::video::SColorf getAmbientLight() const
Return ambient light of the scene which is written.
Definition IColladaMeshWriter.hpp:270
 
virtual void setNameGenerator(IColladaMeshWriterNames *nameGenerator)
Install a generator to create custom names on export.
Definition IColladaMeshWriter.hpp:362
 
Interface for writing meshes.
Definition IMeshWriter.hpp:24
 
Class which holds the geometry of an object.
Definition IMesh.hpp:72
 
Scene node interface.
Definition ISceneNode.hpp:43
 
Class representing a 32 bit ARGB color.
Definition SColor.hpp:317
 
Class representing a color with four floats.
Definition SColor.hpp:574
 
Class for holding parameters for a material renderer.
Definition SMaterial.hpp:304
 
E_COLLADA_DCPP_COLOR
Duckcpp colors which can be mapped to E_COLLADA_COLOR_SAMPLER values.
Definition IColladaMeshWriter.hpp:59
 
@ ECIC_DIFFUSE
Use SMaterial::DiffuseColor.
Definition IColladaMeshWriter.hpp:67
 
@ ECIC_SPECULAR
Use SMaterial::SpecularColor.
Definition IColladaMeshWriter.hpp:76
 
@ ECIC_NONE
Don't write this element at all.
Definition IColladaMeshWriter.hpp:61
 
@ ECIC_AMBIENT
Use SMaterial::AmbientColor.
Definition IColladaMeshWriter.hpp:70
 
@ ECIC_EMISSIVE
Use SMaterial::EmissiveColor.
Definition IColladaMeshWriter.hpp:73
 
@ ECIC_CUSTOM
Check IColladaMeshWriterProperties for custom color.
Definition IColladaMeshWriter.hpp:64
 
E_COLLADA_TECHNIQUE_FX
Lighting models - more or less the way Collada categorizes materials.
Definition IColladaMeshWriter.hpp:24
 
@ ECTF_BLINN
Definition IColladaMeshWriter.hpp:27
 
@ ECTF_PHONG
Phong shading, default in many external renderers.
Definition IColladaMeshWriter.hpp:29
 
@ ECTF_LAMBERT
diffuse shaded surface that is independent of lighting.
Definition IColladaMeshWriter.hpp:31
 
E_COLLADA_COLOR_SAMPLER
Color names collada uses in it's color samplers.
Definition IColladaMeshWriter.hpp:48
 
E_COLLADA_GEOMETRY_WRITING
Control when geometry elements are created.
Definition IColladaMeshWriter.hpp:81
 
@ ECGI_PER_MESH_AND_MATERIAL
Definition IColladaMeshWriter.hpp:88
 
@ ECGI_PER_MESH
Default - write each mesh exactly once to collada. Optimal but will not work with many tools.
Definition IColladaMeshWriter.hpp:83
 
E_COLLADA_TRANSPARENT_FX
How to interpret the opacity in collada.
Definition IColladaMeshWriter.hpp:38
 
@ ECOF_RGB_ZERO
Alpha values for each RGB channel of color or texture are used.
Definition IColladaMeshWriter.hpp:43
 
@ ECOF_A_ONE
default - only alpha channel of color or texture is used.
Definition IColladaMeshWriter.hpp:40
 
As of Duckcpp 1.6, position2d is a synonym for vector2d.
Definition vector3d.hpp:11
 
float float32_kt
32 bit floating point variable.
Definition irrTypes.hpp:108
 
signed int int32_kt
32 bit signed variable.
Definition irrTypes.hpp:72