TDME2 1.9.121
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Static Public Member Functions | Static Private Attributes | List of all members
Tools Class Referencefinal

Editor tools. More...

#include <tdme/tools/editor/misc/Tools.h>

Collaboration diagram for Tools:
Collaboration graph

Classes

struct  ToolsShutdown
 

Static Public Member Functions

static string formatFloat (float value)
 Formats a float to a human readable format. More...
 
static void setDefaultLight (Light *light)
 Set up given engine light with default light. More...
 
static void oseInit ()
 Init off screen engine for making thumbails. More...
 
static void oseDispose ()
 Dispose off screen engine. More...
 
static void oseThumbnail (Prototype *prototype, vector< uint8_t > &pngData)
 Make a thumbnail of given prototype with off screen engine. More...
 
static float computeMaxAxisDimension (BoundingBox *boundingBox)
 Compute max axis dimension for given bounding box. More...
 
static ModelcreateGroundModel (float width, float depth, float y)
 Creates ground plate with 1m x 1m texture. More...
 
static ModelcreateGridModel ()
 Creates grid plate with 1m x 1m texture. More...
 
static void setupPrototype (Prototype *prototype, Engine *engine, const Transformations &lookFromRotations, int lodLevel, Vector3 &objectScale, CameraRotationInputHandler *cameraRotationInputHandler=nullptr, float scale=1.5f, bool resetup=false)
 Set up entity in given engine with look from rotations and scale. More...
 
static const string getRelativeResourcesFileName (const string &applicationRoot, const string &fileName)
 Get relative resources file name. More...
 
static const string getApplicationRootPathName (const string &fileName)
 Get application root path name. More...
 
static const string getApplicationSubPathName (const string &fileName)
 Get application sub path name. More...
 
static const string getPathName (const string &fileName)
 Get path of given file name. More...
 
static const string getFileName (const string &fileName)
 Get file name of given file name. More...
 
static const string removeFileEnding (const string &fileName)
 Remove file ending, e.g. More...
 
static const string ensureFileEnding (const string &fileName, const string &extension)
 Ensure file ending. More...
 
static void loadSettings (Application *application)
 Load settings. More...
 
static ModelgetGizmoAll ()
 
static ModelgetGizmoTranslationScale ()
 
static ModelgetGizmoTranslation ()
 
static ModelgetGizmoScale ()
 
static ModelgetGizmoRotations ()
 
static ModelgetDefaultObb ()
 

Static Private Attributes

static STATIC_DLL_IMPEXT EngineosEngine = nullptr
 
static STATIC_DLL_IMPEXT ModelgizmoAll = nullptr
 
static STATIC_DLL_IMPEXT ModelgizmoTranslationScale = nullptr
 
static STATIC_DLL_IMPEXT ModelgizmoTranslation = nullptr
 
static STATIC_DLL_IMPEXT ModelgizmoScale = nullptr
 
static STATIC_DLL_IMPEXT ModelgizmoRotations = nullptr
 
static STATIC_DLL_IMPEXT ModeldefaultOBB = nullptr
 
static STATIC_DLL_IMPEXT ToolsShutdown toolsShutdown
 

Detailed Description

Editor tools.

Author
Andreas Drewke
Version
$Id$

Definition at line 37 of file Tools.h.

Member Function Documentation

◆ computeMaxAxisDimension()

float computeMaxAxisDimension ( BoundingBox boundingBox)
static

Compute max axis dimension for given bounding box.

Parameters
boundingBoxbounding box
Returns
max axis dimension

Definition at line 178 of file Tools.cpp.

◆ createGridModel()

Model * createGridModel ( )
static

Creates grid plate with 1m x 1m texture.

Returns
grid model

Definition at line 228 of file Tools.cpp.

◆ createGroundModel()

Model * createGroundModel ( float  width,
float  depth,
float  y 
)
static

Creates ground plate with 1m x 1m texture.

Parameters
widthwidth
depthdepth
yfloat y
Returns
ground model

Definition at line 188 of file Tools.cpp.

◆ ensureFileEnding()

const string ensureFileEnding ( const string &  fileName,
const string &  extension 
)
static

Ensure file ending.

Parameters
fileNamefile name
extensionextension
Returns
file name

Definition at line 562 of file Tools.cpp.

◆ formatFloat()

string formatFloat ( float  value)
static

Formats a float to a human readable format.

Parameters
valuevalue
Returns
value as string

Definition at line 120 of file Tools.cpp.

◆ getApplicationRootPathName()

const string getApplicationRootPathName ( const string &  fileName)
static

Get application root path name.

Parameters
fileNamefile name
Returns
application root path name

Definition at line 496 of file Tools.cpp.

◆ getApplicationSubPathName()

const string getApplicationSubPathName ( const string &  fileName)
static

Get application sub path name.

Parameters
fileNameapplication sub path name
Returns
application sub path name

Definition at line 513 of file Tools.cpp.

◆ getDefaultObb()

Model * getDefaultObb ( )
static
Returns
default obb

Definition at line 635 of file Tools.cpp.

◆ getFileName()

const string getFileName ( const string &  fileName)
static

Get file name of given file name.

Parameters
fileNamefile name
Returns
file name

Definition at line 547 of file Tools.cpp.

◆ getGizmoAll()

Model * getGizmoAll ( )
static
Returns
GIZMO translation/rotations/scale

Definition at line 600 of file Tools.cpp.

◆ getGizmoRotations()

Model * getGizmoRotations ( )
static
Returns
GIZMO for rotations

Definition at line 628 of file Tools.cpp.

◆ getGizmoScale()

Model * getGizmoScale ( )
static
Returns
GIZMO for scale

Definition at line 621 of file Tools.cpp.

◆ getGizmoTranslation()

Model * getGizmoTranslation ( )
static
Returns
GIZMO for translation

Definition at line 614 of file Tools.cpp.

◆ getGizmoTranslationScale()

Model * getGizmoTranslationScale ( )
static
Returns
GIZMO translation/rotations/scale

Definition at line 607 of file Tools.cpp.

◆ getPathName()

const string getPathName ( const string &  fileName)
static

Get path of given file name.

Parameters
fileNamefile name
Returns
path

Definition at line 542 of file Tools.cpp.

◆ getRelativeResourcesFileName()

const string getRelativeResourcesFileName ( const string &  applicationRoot,
const string &  fileName 
)
static

Get relative resources file name.

Parameters
applicationRootapplication root
fileNamefile name
Returns
relative resources file name

Definition at line 477 of file Tools.cpp.

◆ loadSettings()

void loadSettings ( Application application)
static

Load settings.

Parameters
applicationapplication

Definition at line 571 of file Tools.cpp.

◆ oseDispose()

void oseDispose ( )
static

Dispose off screen engine.

Definition at line 150 of file Tools.cpp.

◆ oseInit()

void oseInit ( )
static

Init off screen engine for making thumbails.

Definition at line 142 of file Tools.cpp.

◆ oseThumbnail()

void oseThumbnail ( Prototype prototype,
vector< uint8_t > &  pngData 
)
static

Make a thumbnail of given prototype with off screen engine.

Parameters
prototypeprototype
pngDataPNG data

Definition at line 157 of file Tools.cpp.

◆ removeFileEnding()

const string removeFileEnding ( const string &  fileName)
static

Remove file ending, e.g.

.dae, .fbx, ...

Parameters
fileNamefile name
Returns
file name

Definition at line 552 of file Tools.cpp.

◆ setDefaultLight()

void setDefaultLight ( Light light)
static

Set up given engine light with default light.

Parameters
lightlight

Definition at line 127 of file Tools.cpp.

◆ setupPrototype()

void setupPrototype ( Prototype prototype,
Engine engine,
const Transformations lookFromRotations,
int  lodLevel,
Vector3 objectScale,
CameraRotationInputHandler cameraRotationInputHandler = nullptr,
float  scale = 1.5f,
bool  resetup = false 
)
static

Set up entity in given engine with look from rotations and scale.

Parameters
prototypeprototype
engineengine
lookFromRotationslook from rotations
lodLevellod level
cameraRotationInputHandlercamera rotation input handler
resetupresetup which would mean to leave camera and lighting as is

Definition at line 275 of file Tools.cpp.

Member Data Documentation

◆ defaultOBB

Model * defaultOBB = nullptr
staticprivate

Definition at line 46 of file Tools.h.

◆ gizmoAll

Model * gizmoAll = nullptr
staticprivate

Definition at line 41 of file Tools.h.

◆ gizmoRotations

Model * gizmoRotations = nullptr
staticprivate

Definition at line 45 of file Tools.h.

◆ gizmoScale

Model * gizmoScale = nullptr
staticprivate

Definition at line 44 of file Tools.h.

◆ gizmoTranslation

Model * gizmoTranslation = nullptr
staticprivate

Definition at line 43 of file Tools.h.

◆ gizmoTranslationScale

Model * gizmoTranslationScale = nullptr
staticprivate

Definition at line 42 of file Tools.h.

◆ osEngine

Engine * osEngine = nullptr
staticprivate

Definition at line 40 of file Tools.h.

◆ toolsShutdown

Tools::ToolsShutdown toolsShutdown
staticprivate

Definition at line 52 of file Tools.h.


The documentation for this class was generated from the following files: