Ignition Common

API Reference

4.4.0
ColladaExporter.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 #ifndef IGNITION_COMMON_COLLADAEXPORTER_HH_
18 #define IGNITION_COMMON_COLLADAEXPORTER_HH_
19 
20 #include <memory>
21 #include <string>
22 #include <vector>
23 
25 #include <ignition/common/graphics/Export.hh>
26 
27 #include <ignition/math/Color.hh>
28 #include <ignition/math/Matrix4.hh>
29 
30 #include <ignition/utils/ImplPtr.hh>
31 
32 namespace ignition
33 {
34  namespace common
35  {
38  struct ColladaLight
39  {
42 
45 
48 
51 
54 
56  double constantAttenuation = 1.0;
57 
59  double linearAttenuation = 0.0;
60 
62  double quadraticAttenuation = 0.0;
63 
65  double falloffAngleDeg = 180.0;
66 
68  double falloffExponent = 0.0;
69  };
70 
72  class IGNITION_COMMON_GRAPHICS_VISIBLE ColladaExporter : public MeshExporter
73  {
75  public: ColladaExporter();
76 
78  public: virtual ~ColladaExporter();
79 
85  public: virtual void Export(const Mesh *_mesh,
86  const std::string &_filename, bool _exportTextures = false);
87 
94  public: void Export(const Mesh *_mesh,
95  const std::string &_filename, bool _exportTextures,
96  const std::vector<math::Matrix4d> &_submeshToMatrix);
97 
105  public: void Export(const Mesh *_mesh,
106  const std::string &_filename, bool _exportTextures,
107  const std::vector<math::Matrix4d> &_submeshToMatrix,
108  const std::vector<ColladaLight> &_lights);
109 
111  IGN_UTILS_IMPL_PTR(dataPtr)
112  };
113  }
114 }
115 #endif
std::string name
Name of the light.
Definition: ColladaExporter.hh:41
Base class for exporting meshes.
Definition: MeshExporter.hh:30
This struct contains light data specifically for collada export Defaults set based on collada 1...
Definition: ColladaExporter.hh:38
STL class.
double falloffAngleDeg
Falloff angle in degrees.
Definition: ColladaExporter.hh:65
math::Vector3d direction
Light direction (directional/spot lights only)
Definition: ColladaExporter.hh:47
math::Vector3d position
Light position (non directional lights only)
Definition: ColladaExporter.hh:50
Class used to export Collada mesh files.
Definition: ColladaExporter.hh:72
STL class.
double falloffExponent
Fallof exponent.
Definition: ColladaExporter.hh:68
std::string type
Type of the light. Either "point", "directional" or "spot".
Definition: ColladaExporter.hh:44
double linearAttenuation
Linear attentuation.
Definition: ColladaExporter.hh:59
Forward declarations for the common classes.
double quadraticAttenuation
Quadratic attentuation.
Definition: ColladaExporter.hh:62
double constantAttenuation
Constant attentuation.
Definition: ColladaExporter.hh:56
A 3D mesh.
Definition: Mesh.hh:41
math::Color diffuse
Light diffuse color.
Definition: ColladaExporter.hh:53