AGXDynamics
2.35.0.2
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
{
33
class
AGXOSG_EXPORT
TextureAtlasBuilder
34
{
35
public
:
36
virtual
osg::ref_ptr<osg::Image> createAtlas(
const
agxCollide::Trimesh
* mesh,
osg::Vec2Array
& textureCoordinates,
agx::Real
texelsPerMeter) = 0;
37
38
class
AtlasCreationFailure
:
public
agx::Error
39
{
40
public
:
41
AtlasCreationFailure
(
const
agxCollide::Trimesh
* mesh,
const
std::string& what);
42
const
agxCollide::Mesh
*
mesh
;
43
};
44
};
45
46
47
class
AGXOSG_EXPORT
OsgTextureAtlasBuilder
:
public
TextureAtlasBuilder
48
{
49
public
:
50
virtual
osg::ref_ptr<osg::Image> createAtlas(
const
agxCollide::Trimesh
* mesh,
osg::Vec2Array
& textureCoordinates,
agx::Real
texelsPerMeter)
override
;
51
52
class
AttemptsExhausted
:
public
AtlasCreationFailure
53
{
54
public
:
55
AttemptsExhausted
(
const
agxCollide::Trimesh
* mesh,
int
atlasSizeWidth,
int
atlasSizeHeight,
unsigned
attempts);
56
int
atlasSizeWidth
;
57
int
atlasSizeHeight
;
58
unsigned
attempts
;
59
};
60
};
61
}
62
63
#endif
64
Trimesh.h
agxCollide::Mesh
Mesh is a common base class for triangle meshes, such as Mesh or HeightField.
Definition:
Mesh.h:69
agx::Error
std::runtime_error Error
Definition:
debug.h:50
agx::Real
double Real
Definition:
Real.h:42
agxOSG::OsgTextureAtlasBuilder::AttemptsExhausted::atlasSizeHeight
int atlasSizeHeight
Definition:
TextureAtlasBuilder.h:57
agxOSG::OsgTextureAtlasBuilder
Definition:
TextureAtlasBuilder.h:47
agxOSG::TextureAtlasBuilder::AtlasCreationFailure::mesh
const agxCollide::Mesh * mesh
Definition:
TextureAtlasBuilder.h:42
agxOSG::TextureAtlasBuilder
Definition:
TextureAtlasBuilder.h:33
agxOSG::OsgTextureAtlasBuilder::AttemptsExhausted::attempts
unsigned attempts
Definition:
TextureAtlasBuilder.h:58
agxOSG
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
PushDisableWarnings.h
export.h
agx::Vec2Array
agxData::Array< agx::Vec2 > Vec2Array
Definition:
generated_container_typedefs.h:160
agxOSG::OsgTextureAtlasBuilder::AttemptsExhausted::atlasSizeWidth
int atlasSizeWidth
Definition:
TextureAtlasBuilder.h:56
agxCollide::Trimesh
Triangle mesh for geometric intersection tests.
Definition:
Trimesh.h:42
agxOSG::TextureAtlasBuilder::AtlasCreationFailure
Definition:
TextureAtlasBuilder.h:38
debug.h
AGXOSG_EXPORT
#define AGXOSG_EXPORT
agxOSG::OsgTextureAtlasBuilder::AttemptsExhausted
Definition:
TextureAtlasBuilder.h:52
PopDisableWarnings.h
include
agxOSG
TextureAtlasBuilder.h
Generated on Mon Jan 30 2023 15:44:21 for AGXDynamics by
1.8.17