OpenStructure
Namespaces | Data Structures | Typedefs | Enumerations | Functions | Variables
ost::gfx Namespace Reference

Namespaces

 detail
 
 impl
 
 map_iso
 
 py_gfx_obj
 
 RenderMode
 

Data Structures

struct  Bitmap
 
class  ColladaExporter
 
class  Color
 
class  BasicGradientColorOp
 
class  ByChainColorOp
 
class  ByElementColorOp
 
class  ColorOp
 
class  EntityViewColorOp
 
class  GradientColorOp
 
class  GradientLevelColorOp
 
class  MapHandleColorOp
 
class  UniformColorOp
 
class  Entity
 
class  Exporter
 
class  GfxNode
 
class  GfxNodeVisitor
 
class  GfxObj
 
class  GfxObjBase
 
struct  SpherePrim
 
struct  CylinderPrim
 
struct  TextPrim
 
class  GfxTestObj
 
class  GLWinBase
 
class  GostExporter
 
class  Gradient
 
class  GradientManager
 
class  InputEvent
 
class  MapIso
 
class  MapSlab
 
class  Material
 
class  PovState
 
class  PrimList
 
class  Primitive
 
class  Cuboid
 
class  Quad
 
class  CartoonRenderOptions
 
class  CPKRenderOptions
 
class  CustomRenderOptions
 
class  LineRenderOptions
 
class  LineTraceRenderOptions
 
class  RenderOptions
 
class  SimpleRenderOptions
 
class  SlineRenderOptions
 
class  TraceRenderOptions
 
struct  Viewport
 
class  Scene
 
class  SceneObserver
 
class  Selection
 
class  Shader
 
class  Surface
 
class  SymmetryOp
 
class  SymmetryNode
 
class  Texture
 
class  IndexedVertexArray
 
class  GfxNodeListAttrProxy
 
class  GfxNodeListProxy
 

Typedefs

typedef unsigned char ColorMask
 
typedef boost::shared_ptr< UniformColorOpUniformColorOpP
 
typedef std::vector< RenderMode::TypeRenderModeTypes
 
typedef boost::shared_ptr< EntityEntityP
 
typedef boost::weak_ptr< EntityEntityW
 
typedef std::vector< GfxNodePGfxNodeVector
 
typedef boost::shared_ptr< GfxNodeGfxNodeP
 
typedef std::vector< GfxNodePNodePtrList
 
typedef boost::shared_ptr< GfxObjBaseGfxObjBaseP
 
typedef boost::shared_ptr< GfxObjGfxObjP
 
typedef std::vector< SpherePrimSpherePrimList
 
typedef std::vector< CylinderPrimCylinderPrimList
 
typedef std::vector< TextPrimTextPrimList
 
typedef boost::shared_ptr< MapIsoMapIsoP
 
typedef boost::shared_ptr< MapSlabMapSlabP
 
typedef boost::shared_ptr< CartoonRenderOptionsCartoonRenderOptionsPtr
 
typedef boost::shared_ptr< CPKRenderOptionsCPKRenderOptionsPtr
 
typedef boost::shared_ptr< CustomRenderOptionsCustomRenderOptionsPtr
 
typedef boost::shared_ptr< LineRenderOptionsLineRenderOptionsPtr
 
typedef boost::shared_ptr< LineTraceRenderOptionsLineTraceRenderOptionsPtr
 
typedef boost::shared_ptr< RenderOptionsRenderOptionsPtr
 
typedef boost::shared_ptr< SimpleRenderOptionsSimpleRenderOptionsPtr
 
typedef boost::shared_ptr< SlineRenderOptionsSlineRenderOptionsPtr
 
typedef boost::shared_ptr< TraceRenderOptionsTraceRenderOptionsPtr
 
typedef std::vector< SceneObserver * > SceneObserverList
 
typedef boost::shared_ptr< SurfaceSurfaceP
 
typedef std::vector< SymmetryOpSymmetryOpList
 
typedef unsigned int VertexID
 
typedef unsigned int LineID
 
typedef unsigned int TriID
 
typedef unsigned int QuadID
 

Enumerations

enum  ColorBit { DETAIL_COLOR = 1 , MAIN_COLOR = 2 }
 
enum  InputDevice { INPUT_DEVICE_DUMMY =0 , INPUT_DEVICE_MOUSE }
 
enum  InputCommand {
  INPUT_COMMAND_NONE =0 , INPUT_COMMAND_ROTX , INPUT_COMMAND_ROTY , INPUT_COMMAND_ROTZ ,
  INPUT_COMMAND_TRANSX , INPUT_COMMAND_TRANSY , INPUT_COMMAND_TRANSZ , INPUT_COMMAND_SLABN ,
  INPUT_COMMAND_SLABF , INPUT_COMMAND_AUTOSLAB , INPUT_COMMAND_TOGGLE_FOG , INPUT_COMMAND_CUSTOM1 ,
  INPUT_COMMAND_CUSTOM2 , INPUT_COMMAND_CUSTOM3 , INPUT_COMMAND_REBUILD
}
 
enum  TransformTarget {
  TRANSFORM_VIEW =0 , TRANSFORM_RIGID , TRANSFORM_TORSION , TRANSFORM_ANGLE ,
  TRANSFORM_ROTAMER
}
 
enum  MapIsoType { ORIGINAL_MAP , DOWNSAMPLED_MAP }
 
enum  RenderPass {
  STANDARD_RENDER_PASS , GLOW_RENDER_PASS , DEPTH_RENDER_PASS , TRANSPARENT_RENDER_PASS ,
  OVERLAY_RENDER_PASS
}
 

Functions

void DLLEXPORT_OST_GFX ExportBitmap (const String &fname, std::string ext, unsigned int width, unsigned int height, unsigned char *data)
 
Bitmap DLLEXPORT_OST_GFX ImportBitmap (const String &fname, std::string ext="")
 
Color DLLEXPORT_OST_GFX RGB (float r, float g, float b)
 
Color DLLEXPORT_OST_GFX RGBb (uchar r, uchar g, uchar b)
 
Color DLLEXPORT_OST_GFX RGBi (unsigned int r, unsigned int g, unsigned int b)
 
Color DLLEXPORT_OST_GFX RGBA (float r, float g, float b, float a)
 
Color DLLEXPORT_OST_GFX RGBAb (uchar r, uchar g, uchar b, uchar a)
 
Color DLLEXPORT_OST_GFX RGBAi (unsigned int r, unsigned int g, unsigned int b, unsigned int a)
 
Color DLLEXPORT_OST_GFX HSV (float h, float s, float v)
 
Color DLLEXPORT_OST_GFX HSVi (int h, int s, int v)
 
Color DLLEXPORT_OST_GFX HSVA (float h, float s, float v, float a)
 
Color DLLEXPORT_OST_GFX HSVAi (int h, int s, int v, int a)
 
DLLEXPORT_OST_GFX std::ostream & operator<< (std::ostream &, const Color &c)
 
def Stereo (mode, flip=None, alg=None)
 
def FitToScreen (gfx_ent, width=None, height=None, margin=0.05)
 
def GostExporter (file, scale=1.0, to_origin=True)
 
def ColladaExporter (file, scale=1.0, to_origin=True)
 

Variables

static const unsigned int VA_SPHERE_MAX_DETAIL =12
 
static const unsigned int VA_ICO_SPHERE_MAX_DETAIL =4
 
static const unsigned int VA_CYL_MAX_DETAIL =12
 
 WHITE = RGB(1.0,1.0,1.0)
 
 BLACK = RGB(0.0,0.0,0.0)
 
 GREY = RGB(0.5,0.5,0.5)
 
 RED = RGB(1.0,0.0,0.0)
 
 DARKRED = RGB(0.5,0.0,0.0)
 
 LIGHTRED = RGB(1.0,0.5,0.5)
 
 GREEN = RGB(0.0,1.0,0.0)
 
 DARKGREEN = RGB(0.0,0.5,0.0)
 
 LIGHTGREEN = RGB(0.5,1.0,0.5)
 
 BLUE = RGB(0.0,0.0,1.0)
 
 DARKBLUE = RGB(0.0,0.0,0.5)
 
 LIGHTBLUE = RGB(0.5,0.5,1.0)
 
 YELLOW = RGB(1.0,1.0,0.0)
 
 DARKYELLOW = RGB(0.5,0.5,0.0)
 
 LIGHTYELLOW = RGB(1.0,1.0,0.5)
 
 CYAN = RGB(0.0,1.0,1.0)
 
 DARKCYAN = RGB(0.0,0.5,0.5)
 
 LIGHTCYAN = RGB(0.5,1.0,1.0)
 
 MAGENTA = RGB(1.0,0.0,1.0)
 
 DARKMAGENTA = RGB(0.5,0.0,0.5)
 
 LIGHTMAGENTA = RGB(1.0,0.5,1.0)
 
 PURPLE = MAGENTA
 
 DARKPURPLE = DARKMAGENTA
 
 LIGHTPURPLE = LIGHTMAGENTA
 
 ORANGE = RGB(1.0,0.5,0.0)
 
 DARKORANGE = RGB(0.5,0.25,0.0)
 
 LIGHTORANGE = RGB(1.0,0.75,0.5)
 
 scene
 
 Stereo
 

Typedef Documentation

◆ CartoonRenderOptionsPtr

typedef boost::shared_ptr<CartoonRenderOptions> CartoonRenderOptionsPtr

Definition at line 137 of file cartoon_render_options.hh.

◆ ColorMask

typedef unsigned char ColorMask

Definition at line 43 of file color_op.hh.

◆ CPKRenderOptionsPtr

typedef boost::shared_ptr<CPKRenderOptions> CPKRenderOptionsPtr

Definition at line 62 of file cpk_render_options.hh.

◆ CustomRenderOptionsPtr

typedef boost::shared_ptr<CustomRenderOptions> CustomRenderOptionsPtr

Definition at line 62 of file custom_render_options.hh.

◆ CylinderPrimList

typedef std::vector<CylinderPrim> CylinderPrimList

Definition at line 105 of file gfx_prim.hh.

◆ EntityP

typedef boost::shared_ptr<Entity> EntityP

Definition at line 28 of file entity_fw.hh.

◆ EntityW

typedef boost::weak_ptr<Entity> EntityW

Definition at line 29 of file entity_fw.hh.

◆ GfxNodeP

typedef boost::shared_ptr<GfxNode> GfxNodeP

Definition at line 33 of file gfx_node_fw.hh.

◆ GfxNodeVector

typedef std::vector<GfxNodeP> GfxNodeVector

Definition at line 41 of file gfx_node.hh.

◆ GfxObjBaseP

typedef boost::shared_ptr<GfxObjBase> GfxObjBaseP

Definition at line 31 of file gfx_object_fw.hh.

◆ GfxObjP

typedef boost::shared_ptr<GfxObj> GfxObjP

Definition at line 33 of file gfx_object_fw.hh.

◆ LineID

typedef unsigned int LineID

Definition at line 47 of file vertex_array.hh.

◆ LineRenderOptionsPtr

typedef boost::shared_ptr<LineRenderOptions> LineRenderOptionsPtr

Definition at line 53 of file line_render_options.hh.

◆ LineTraceRenderOptionsPtr

Definition at line 43 of file line_trace_render_options.hh.

◆ MapIsoP

typedef boost::shared_ptr<MapIso> MapIsoP

Definition at line 44 of file map_iso.hh.

◆ MapSlabP

typedef boost::shared_ptr<MapSlab> MapSlabP

Definition at line 39 of file map_slab.hh.

◆ NodePtrList

typedef std::vector<GfxNodeP> NodePtrList

Definition at line 34 of file gfx_node_fw.hh.

◆ QuadID

typedef unsigned int QuadID

Definition at line 49 of file vertex_array.hh.

◆ RenderModeTypes

typedef std::vector<RenderMode::Type> RenderModeTypes

Definition at line 50 of file entity.hh.

◆ RenderOptionsPtr

typedef boost::shared_ptr<RenderOptions> RenderOptionsPtr

Definition at line 38 of file render_options.hh.

◆ SceneObserverList

typedef std::vector<SceneObserver*> SceneObserverList

Definition at line 53 of file scene.hh.

◆ SimpleRenderOptionsPtr

typedef boost::shared_ptr<SimpleRenderOptions> SimpleRenderOptionsPtr

Definition at line 59 of file simple_render_options.hh.

◆ SlineRenderOptionsPtr

typedef boost::shared_ptr<SlineRenderOptions> SlineRenderOptionsPtr

Definition at line 50 of file sline_render_options.hh.

◆ SpherePrimList

typedef std::vector<SpherePrim> SpherePrimList

Definition at line 47 of file gfx_prim.hh.

◆ SurfaceP

typedef boost::shared_ptr<Surface> SurfaceP

Definition at line 44 of file surface.hh.

◆ SymmetryOpList

typedef std::vector<SymmetryOp> SymmetryOpList

Definition at line 45 of file symmetry_node.hh.

◆ TextPrimList

typedef std::vector<TextPrim> TextPrimList

Definition at line 117 of file gfx_prim.hh.

◆ TraceRenderOptionsPtr

typedef boost::shared_ptr<TraceRenderOptions> TraceRenderOptionsPtr

Definition at line 60 of file trace_render_options.hh.

◆ TriID

typedef unsigned int TriID

Definition at line 48 of file vertex_array.hh.

◆ UniformColorOpP

typedef boost::shared_ptr<UniformColorOp> UniformColorOpP

Definition at line 57 of file uniform_color_op.hh.

◆ VertexID

typedef unsigned int VertexID

Definition at line 46 of file vertex_array.hh.

Enumeration Type Documentation

◆ ColorBit

enum ColorBit
Enumerator
DETAIL_COLOR 
MAIN_COLOR 

Definition at line 38 of file color_op.hh.

◆ InputCommand

Enumerator
INPUT_COMMAND_NONE 
INPUT_COMMAND_ROTX 
INPUT_COMMAND_ROTY 
INPUT_COMMAND_ROTZ 
INPUT_COMMAND_TRANSX 
INPUT_COMMAND_TRANSY 
INPUT_COMMAND_TRANSZ 
INPUT_COMMAND_SLABN 
INPUT_COMMAND_SLABF 
INPUT_COMMAND_AUTOSLAB 
INPUT_COMMAND_TOGGLE_FOG 
INPUT_COMMAND_CUSTOM1 
INPUT_COMMAND_CUSTOM2 
INPUT_COMMAND_CUSTOM3 
INPUT_COMMAND_REBUILD 

Definition at line 39 of file input.hh.

◆ InputDevice

Enumerator
INPUT_DEVICE_DUMMY 
INPUT_DEVICE_MOUSE 

Definition at line 34 of file input.hh.

◆ MapIsoType

enum MapIsoType
Enumerator
ORIGINAL_MAP 
DOWNSAMPLED_MAP 

Definition at line 38 of file map_iso.hh.

◆ RenderPass

enum RenderPass
Enumerator
STANDARD_RENDER_PASS 

shaded and textured renderpass, intended to be shown directly to the user

GLOW_RENDER_PASS 

only renders "glowing" parts objects

DEPTH_RENDER_PASS 

renders objects with solid color as used for shadow map generation

TRANSPARENT_RENDER_PASS 

\ brief for transparent objects the standard render pass is not supposed to render transparent objects, as they should get drawn after the rest of the scene

OVERLAY_RENDER_PASS 

Definition at line 27 of file render_pass.hh.

◆ TransformTarget

Enumerator
TRANSFORM_VIEW 
TRANSFORM_RIGID 
TRANSFORM_TORSION 
TRANSFORM_ANGLE 
TRANSFORM_ROTAMER 

Definition at line 57 of file input.hh.

Function Documentation

◆ ColladaExporter()

def ost.gfx.ColladaExporter (   file,
  scale = 1.0,
  to_origin = True 
)

Definition at line 407 of file __init__.py.

◆ ExportBitmap()

void DLLEXPORT_OST_GFX ost::gfx::ExportBitmap ( const String fname,
std::string  ext,
unsigned int  width,
unsigned int  height,
unsigned char *  data 
)

◆ FitToScreen()

def ost.gfx.FitToScreen (   gfx_ent,
  width = None,
  height = None,
  margin = 0.05 
)
Setup camera such that it is centered on the graphical entity and the entity 
fits the entire viewport. The longest axes of the entity are aligned along 
the x- and y- axes of the screen.

:param gfx_ent: The graphical entity
:type gfx_ent: str or :class:`Entity`

Definition at line 69 of file __init__.py.

◆ GostExporter()

def ost.gfx.GostExporter (   file,
  scale = 1.0,
  to_origin = True 
)

Definition at line 401 of file __init__.py.

◆ HSV()

Color DLLEXPORT_OST_GFX ost::gfx::HSV ( float  h,
float  s,
float  v 
)

HSV color spec from floats.

h: Hue from 0 to 1 (0=red, 2/6=green, 4/6=blue) outside values are modulus 1, not clamped s: Saturation from 0 (no color) to 1 (full color) outside values are clamped v: Value from 0 (no light, black) to 1 (full light) outside values are clamped

out-of-bounds values are perfectly fine, as they are sometimes needed in hsv gradients, e.g.

g1=gfx.Gradient([gfx.HSV(-60.0/360.0,1,1),gfx.HSV(60.0/360.0,1,1)]) g1.hsv_mode=True g2=gfx.Gradient([gfx.HSV(300.0/360.0,1,1),gfx.HSV(420.0/360.0,1,1)]) g2.hsv_mode=True

both will blend from purple to yellow via red

◆ HSVA()

Color DLLEXPORT_OST_GFX ost::gfx::HSVA ( float  h,
float  s,
float  v,
float  a 
)

HSVA color spec from floats.

see HSV(float,float,float); alpha from 0 to 1

◆ HSVAi()

Color DLLEXPORT_OST_GFX ost::gfx::HSVAi ( int  h,
int  s,
int  v,
int  a 
)

HSVA color spec from integers.

see HSVi(int, int, int); alpha from 0 to 100

◆ HSVi()

Color DLLEXPORT_OST_GFX ost::gfx::HSVi ( int  h,
int  s,
int  v 
)

HSV color spec from integers.

h: Hue from 0 to 359 (0=red, 120=green, 240=blue) outside values are modulus 360, not clamped s: Saturation from 0 (no color) to 100 (full color) outside values are clamped v: Value from 0 (no light, black) to 100 (full light) outside values are clamped

signed integers on purpose, allows negative values to be used for hsv gradients, see comments for HSV(float,float,float)

◆ ImportBitmap()

Bitmap DLLEXPORT_OST_GFX ost::gfx::ImportBitmap ( const String fname,
std::string  ext = "" 
)

◆ operator<<()

DLLEXPORT_OST_GFX std::ostream& ost::gfx::operator<< ( std::ostream &  ,
const Color c 
)

string form

◆ RGB()

Color DLLEXPORT_OST_GFX ost::gfx::RGB ( float  r,
float  g,
float  b 
)

RGB color spec from floats (0.0-1.0)

◆ RGBA()

Color DLLEXPORT_OST_GFX ost::gfx::RGBA ( float  r,
float  g,
float  b,
float  a 
)

RGBA color spec from floats (0.0-1.0)

◆ RGBAb()

Color DLLEXPORT_OST_GFX ost::gfx::RGBAb ( uchar  r,
uchar  g,
uchar  b,
uchar  a 
)

RGBA color spec from bytes (0-255)

◆ RGBAi()

Color DLLEXPORT_OST_GFX ost::gfx::RGBAi ( unsigned int  r,
unsigned int  g,
unsigned int  b,
unsigned int  a 
)

RGBA color spec from integers (0-65535)

◆ RGBb()

Color DLLEXPORT_OST_GFX ost::gfx::RGBb ( uchar  r,
uchar  g,
uchar  b 
)

RGB color spec from bytes (0-255)

◆ RGBi()

Color DLLEXPORT_OST_GFX ost::gfx::RGBi ( unsigned int  r,
unsigned int  g,
unsigned int  b 
)

RGB color spec from integers (0-65535)

◆ Stereo()

def ost.gfx.Stereo (   mode,
  flip = None,
  alg = None 
)
Stereo control

:param mode: 0=off, 1=quad-buffered, 2=interlaced
:type mode: int
:param flip: invert order of left/right display
:type flip: bool
:param alg: stereo algorithm (0 or 1)
:type param: int

Definition at line 51 of file __init__.py.

Variable Documentation

◆ BLACK

BLACK = RGB(0.0,0.0,0.0)

Definition at line 24 of file __init__.py.

◆ BLUE

BLUE = RGB(0.0,0.0,1.0)

Definition at line 32 of file __init__.py.

◆ CYAN

CYAN = RGB(0.0,1.0,1.0)

Definition at line 38 of file __init__.py.

◆ DARKBLUE

DARKBLUE = RGB(0.0,0.0,0.5)

Definition at line 33 of file __init__.py.

◆ DARKCYAN

DARKCYAN = RGB(0.0,0.5,0.5)

Definition at line 39 of file __init__.py.

◆ DARKGREEN

DARKGREEN = RGB(0.0,0.5,0.0)

Definition at line 30 of file __init__.py.

◆ DARKMAGENTA

DARKMAGENTA = RGB(0.5,0.0,0.5)

Definition at line 42 of file __init__.py.

◆ DARKORANGE

DARKORANGE = RGB(0.5,0.25,0.0)

Definition at line 48 of file __init__.py.

◆ DARKPURPLE

DARKPURPLE = DARKMAGENTA

Definition at line 45 of file __init__.py.

◆ DARKRED

DARKRED = RGB(0.5,0.0,0.0)

Definition at line 27 of file __init__.py.

◆ DARKYELLOW

DARKYELLOW = RGB(0.5,0.5,0.0)

Definition at line 36 of file __init__.py.

◆ GREEN

GREEN = RGB(0.0,1.0,0.0)

Definition at line 29 of file __init__.py.

◆ GREY

GREY = RGB(0.5,0.5,0.5)

Definition at line 25 of file __init__.py.

◆ LIGHTBLUE

LIGHTBLUE = RGB(0.5,0.5,1.0)

Definition at line 34 of file __init__.py.

◆ LIGHTCYAN

LIGHTCYAN = RGB(0.5,1.0,1.0)

Definition at line 40 of file __init__.py.

◆ LIGHTGREEN

LIGHTGREEN = RGB(0.5,1.0,0.5)

Definition at line 31 of file __init__.py.

◆ LIGHTMAGENTA

LIGHTMAGENTA = RGB(1.0,0.5,1.0)

Definition at line 43 of file __init__.py.

◆ LIGHTORANGE

LIGHTORANGE = RGB(1.0,0.75,0.5)

Definition at line 49 of file __init__.py.

◆ LIGHTPURPLE

LIGHTPURPLE = LIGHTMAGENTA

Definition at line 46 of file __init__.py.

◆ LIGHTRED

LIGHTRED = RGB(1.0,0.5,0.5)

Definition at line 28 of file __init__.py.

◆ LIGHTYELLOW

LIGHTYELLOW = RGB(1.0,1.0,0.5)

Definition at line 37 of file __init__.py.

◆ MAGENTA

MAGENTA = RGB(1.0,0.0,1.0)

Definition at line 41 of file __init__.py.

◆ ORANGE

ORANGE = RGB(1.0,0.5,0.0)

Definition at line 47 of file __init__.py.

◆ PURPLE

PURPLE = MAGENTA

Definition at line 44 of file __init__.py.

◆ RED

RED = RGB(1.0,0.0,0.0)

Definition at line 26 of file __init__.py.

◆ scene

scene

Definition at line 394 of file __init__.py.

◆ Stereo

Stereo

Definition at line 395 of file __init__.py.

◆ VA_CYL_MAX_DETAIL

const unsigned int VA_CYL_MAX_DETAIL =12
static

Definition at line 29 of file vertex_array_helper.hh.

◆ VA_ICO_SPHERE_MAX_DETAIL

const unsigned int VA_ICO_SPHERE_MAX_DETAIL =4
static

Definition at line 28 of file vertex_array_helper.hh.

◆ VA_SPHERE_MAX_DETAIL

const unsigned int VA_SPHERE_MAX_DETAIL =12
static

Definition at line 27 of file vertex_array_helper.hh.

◆ WHITE

WHITE = RGB(1.0,1.0,1.0)

Definition at line 23 of file __init__.py.

◆ YELLOW

YELLOW = RGB(1.0,1.0,0.0)

Definition at line 35 of file __init__.py.