AGX Dynamics  2.35.0.1
TextureAtlasBuilder.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, is copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 
18 #ifndef AGXOSG_TEXTURE_ATLAS_BUILDER_H
19 #define AGXOSG_TEXTURE_ATLAS_BUILDER_H
20 
21 #include <agx/debug.h>
22 #include <agxCollide/Trimesh.h>
23 
24 #include <agxOSG/export.h>
25 
26 #include <agx/PushDisableWarnings.h> // Disabling warnings. Include agx/PopDisableWarnings.h below!
27 #include <osg/Image>
28 #include <osg/Array>
29 #include <agx/PopDisableWarnings.h> // End of disabled warnings.
30 
31 namespace agxOSG
32 {
34  {
35  public:
36  virtual osg::ref_ptr<osg::Image> createAtlas(const agxCollide::Trimesh* mesh, osg::Vec2Array& textureCoordinates, agx::Real texelsPerMeter) = 0;
37 
39  {
40  public:
41  AtlasCreationFailure(const agxCollide::Trimesh* mesh, const std::string& what);
43  };
44  };
45 
46 
48  {
49  public:
50  virtual osg::ref_ptr<osg::Image> createAtlas(const agxCollide::Trimesh* mesh, osg::Vec2Array& textureCoordinates, agx::Real texelsPerMeter) override;
51 
53  {
54  public:
55  AttemptsExhausted(const agxCollide::Trimesh* mesh, int atlasSizeWidth, int atlasSizeHeight, unsigned attempts);
58  unsigned attempts;
59  };
60  };
61 }
62 
63 #endif
64 
#define AGXOSG_EXPORT
Mesh is a common base class for triangle meshes, such as Mesh or HeightField.
Definition: Mesh.h:70
Triangle mesh for geometric intersection tests.
Definition: Trimesh.h:43
AttemptsExhausted(const agxCollide::Trimesh *mesh, int atlasSizeWidth, int atlasSizeHeight, unsigned attempts)
virtual osg::ref_ptr< osg::Image > createAtlas(const agxCollide::Trimesh *mesh, osg::Vec2Array &textureCoordinates, agx::Real texelsPerMeter) override
AtlasCreationFailure(const agxCollide::Trimesh *mesh, const std::string &what)
virtual osg::ref_ptr< osg::Image > createAtlas(const agxCollide::Trimesh *mesh, osg::Vec2Array &textureCoordinates, agx::Real texelsPerMeter)=0
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
agxData::Array< agx::Vec2 > Vec2Array
double Real
Definition: Real.h:42
std::runtime_error Error
Definition: debug.h:50