ArcGIS Procedural Runtime  3.2.10650
List of all members | Public Types | Public Member Functions
prtx::Shape Class Referenceabstract

#include <Shape.h>

Inheritance diagram for prtx::Shape:
[legend]

Public Types

typedef std::pair< StringPtr, bool > ReportBool
 
typedef std::vector< ReportBool > ReportBoolVect
 
typedef std::pair< StringPtr, double > ReportFloat
 
typedef std::vector< ReportFloat > ReportFloatVect
 
typedef std::pair< StringPtr, StringPtrReportString
 
typedef std::vector< ReportString > ReportStringVect
 
- Public Types inherited from prtx::Attributable
using PrimitiveType = uint8_t
 

Public Member Functions

virtual const CGAErrorPtrVector & getCGAErrors () const =0
 
virtual const std::wstring & getCGAPrint () const =0
 
virtual const ReportBoolVect & getCGAReportsBool () const =0
 
virtual const ReportFloatVect & getCGAReportsFloat () const =0
 
virtual const ReportStringVect & getCGAReportsString () const =0
 
virtual GeometryPtr getGeometry () const =0
 
virtual uint32_t getID () const =0
 
virtual MaterialPtr getMaterial () const =0
 
virtual uint32_t getParentID () const =0
 
virtual int64_t getShapeSymbol () const =0
 
virtual const TrimPlanePtrVectorgetTrimPlanes () const =0
 
- Public Member Functions inherited from prtx::Attributable
virtual void * getBlindData (const std::wstring &key) const =0
 
virtual Bool getBool (const std::wstring &key) const =0
 
virtual const BoolVectorgetBoolArray (const std::wstring &key) const =0
 
virtual double getFloat (const std::wstring &key) const =0
 
virtual const DoubleVectorgetFloatArray (const std::wstring &key) const =0
 
virtual int32_t getInt (const std::wstring &key) const =0
 
virtual const Int32VectorgetIntArray (const std::wstring &key) const =0
 
virtual const WStringVectorgetKeys () const =0
 
virtual const std::wstring & getString (const std::wstring &key) const =0
 
virtual const WStringVectorgetStringArray (const std::wstring &key) const =0
 
virtual PrimitiveType getType (const std::wstring &key) const =0
 
virtual bool hasKey (const std::wstring &key) const =0
 
- Public Member Functions inherited from prtx::BuiltinShapeAttributes
virtual double comp_index () const =0
 
virtual const std::wstring & comp_sel () const =0
 
virtual double comp_total () const =0
 
virtual const std::wstring & initialShape_name () const =0
 
virtual double initialShape_origin_ox () const =0
 
virtual double initialShape_origin_oy () const =0
 
virtual double initialShape_origin_oz () const =0
 
virtual double initialShape_origin_px () const =0
 
virtual double initialShape_origin_py () const =0
 
virtual double initialShape_origin_pz () const =0
 
virtual const std::wstring & initialShape_startRule () const =0
 
virtual double material_ambient_b () const =0
 
virtual double material_ambient_g () const =0
 
virtual double material_ambient_r () const =0
 
virtual const std::wstring & material_bumpmap () const =0
 
virtual double material_bumpmap_rw () const =0
 
virtual double material_bumpmap_su () const =0
 
virtual double material_bumpmap_sv () const =0
 
virtual double material_bumpmap_tu () const =0
 
virtual double material_bumpmap_tv () const =0
 
virtual double material_bumpValue () const =0
 
virtual double material_color_b () const =0
 
virtual double material_color_g () const =0
 
virtual double material_color_r () const =0
 
virtual const std::wstring & material_color_rgb () const =0
 
virtual const std::wstring & material_colormap () const =0
 
virtual double material_colormap_rw () const =0
 
virtual double material_colormap_su () const =0
 
virtual double material_colormap_sv () const =0
 
virtual double material_colormap_tu () const =0
 
virtual double material_colormap_tv () const =0
 
virtual const std::wstring & material_dirtmap () const =0
 
virtual double material_dirtmap_rw () const =0
 
virtual double material_dirtmap_su () const =0
 
virtual double material_dirtmap_sv () const =0
 
virtual double material_dirtmap_tu () const =0
 
virtual double material_dirtmap_tv () const =0
 
virtual bool material_doubleSided () const =0
 
virtual double material_emissive_b () const =0
 
virtual double material_emissive_g () const =0
 
virtual double material_emissive_r () const =0
 
virtual const std::wstring & material_emissivemap () const =0
 
virtual double material_emissivemap_rw () const =0
 
virtual double material_emissivemap_su () const =0
 
virtual double material_emissivemap_sv () const =0
 
virtual double material_emissivemap_tu () const =0
 
virtual double material_emissivemap_tv () const =0
 
virtual double material_metallic () const =0
 
virtual const std::wstring & material_metallicmap () const =0
 
virtual double material_metallicmap_rw () const =0
 
virtual double material_metallicmap_su () const =0
 
virtual double material_metallicmap_sv () const =0
 
virtual double material_metallicmap_tu () const =0
 
virtual double material_metallicmap_tv () const =0
 
virtual const std::wstring & material_name () const =0
 
virtual const std::wstring & material_normalmap () const =0
 
virtual double material_normalmap_rw () const =0
 
virtual double material_normalmap_su () const =0
 
virtual double material_normalmap_sv () const =0
 
virtual double material_normalmap_tu () const =0
 
virtual double material_normalmap_tv () const =0
 
virtual const std::wstring & material_occlusionmap () const =0
 
virtual double material_occlusionmap_rw () const =0
 
virtual double material_occlusionmap_su () const =0
 
virtual double material_occlusionmap_sv () const =0
 
virtual double material_occlusionmap_tu () const =0
 
virtual double material_occlusionmap_tv () const =0
 
virtual double material_opacity () const =0
 
virtual const std::wstring & material_opacitymap () const =0
 
virtual double material_opacitymap_cutoff () const =0
 
virtual const std::wstring & material_opacitymap_mode () const =0
 
virtual double material_opacitymap_rw () const =0
 
virtual double material_opacitymap_su () const =0
 
virtual double material_opacitymap_sv () const =0
 
virtual double material_opacitymap_tu () const =0
 
virtual double material_opacitymap_tv () const =0
 
virtual double material_reflectivity () const =0
 
virtual double material_roughness () const =0
 
virtual const std::wstring & material_roughnessmap () const =0
 
virtual double material_roughnessmap_rw () const =0
 
virtual double material_roughnessmap_su () const =0
 
virtual double material_roughnessmap_sv () const =0
 
virtual double material_roughnessmap_tu () const =0
 
virtual double material_roughnessmap_tv () const =0
 
virtual const std::wstring & material_shader () const =0
 
virtual double material_shininess () const =0
 
virtual double material_specular_b () const =0
 
virtual double material_specular_g () const =0
 
virtual double material_specular_r () const =0
 
virtual const std::wstring & material_specularmap () const =0
 
virtual double material_specularmap_rw () const =0
 
virtual double material_specularmap_su () const =0
 
virtual double material_specularmap_sv () const =0
 
virtual double material_specularmap_tu () const =0
 
virtual double material_specularmap_tv () const =0
 
virtual double pivot_ox () const =0
 
virtual double pivot_oy () const =0
 
virtual double pivot_oz () const =0
 
virtual double pivot_px () const =0
 
virtual double pivot_py () const =0
 
virtual double pivot_pz () const =0
 
virtual double scope_rx () const =0
 
virtual double scope_ry () const =0
 
virtual double scope_rz () const =0
 
virtual double scope_sx () const =0
 
virtual double scope_sy () const =0
 
virtual double scope_sz () const =0
 
virtual double scope_tx () const =0
 
virtual double scope_ty () const =0
 
virtual double scope_tz () const =0
 
virtual double seedian () const =0
 
virtual double split_index () const =0
 
virtual double split_total () const =0
 
virtual bool trim_horizontal () const =0
 
virtual bool trim_vertical () const =0
 

Additional Inherited Members

- Static Public Attributes inherited from prtx::Attributable
static constexpr PrimitiveType PT_BLIND_DATA = prt::Attributable::PT_BLIND_DATA
 
static constexpr PrimitiveType PT_BLIND_DATA_ARRAY = prt::Attributable::PT_BLIND_DATA_ARRAY
 
static constexpr PrimitiveType PT_BOOL = prt::Attributable::PT_BOOL
 
static constexpr PrimitiveType PT_BOOL_ARRAY = prt::Attributable::PT_BOOL_ARRAY
 
static constexpr PrimitiveType PT_COUNT = prt::Attributable::PT_COUNT
 
static constexpr PrimitiveType PT_FLOAT = prt::Attributable::PT_FLOAT
 
static constexpr PrimitiveType PT_FLOAT_ARRAY = prt::Attributable::PT_FLOAT_ARRAY
 
static constexpr PrimitiveType PT_INT = prt::Attributable::PT_INT
 
static constexpr PrimitiveType PT_INT_ARRAY = prt::Attributable::PT_INT_ARRAY
 
static constexpr PrimitiveType PT_STRING = prt::Attributable::PT_STRING
 
static constexpr PrimitiveType PT_STRING_ARRAY = prt::Attributable::PT_STRING_ARRAY
 
static constexpr PrimitiveType PT_UNDEFINED = prt::Attributable::PT_UNDEFINED
 
- Protected Member Functions inherited from prtx::BuiltinShapeAttributes
virtual void fillBuiltinKeys (WStringVector &keys) const override
 
virtual bool getBuiltinBool (const std::wstring &k, bool &stat) const override
 
virtual double getBuiltinFloat (const std::wstring &k, bool &stat) const override
 
virtual const std::wstring & getBuiltinString (const std::wstring &k, bool &val) const override
 
virtual prt::Attributable::PrimitiveType getBuiltinType (const std::wstring &k) const override
 

Detailed Description

The Shape class represents a node of the shape tree. A cga rule is applied on a shape, resulting in a number of new shapes, the successors (which have the original shape set as their parent). Each shape has a unique ID, and the tree structure is encoded in the parent ID of the shapes.

Shape attributes can be read either through the Attributable interface (via their cga name, e.g. L"scope.sx" or L"material.colormap") or through the dedicated getters in the BuiltinShapeAttributes interface (e.g. scope_sx() or material_colormap()). If possible use the latter because they are faster.

Generic CGA attributes can be read through the Attributable interface. CGA array attributes can be 2 dimensional. If an array attribute has more than 1 row, an additional int attribute is present, containing the number of rows. Its name is /arrayDimRows/<array attr name>.

The built-ins CGA attribute keys are:

There are also the intrinsic keys:

Member Function Documentation

◆ getCGAErrors()

virtual const CGAErrorPtrVector& prtx::Shape::getCGAErrors ( ) const
pure virtual
Returns
a vector with all CGAErrors which occurred during generate().

◆ getCGAPrint()

virtual const std::wstring& prtx::Shape::getCGAPrint ( ) const
pure virtual
Returns
a string which is a concatenation of all print() operations and functions which occurred during generate().

◆ getCGAReportsBool()

virtual const ReportBoolVect& prtx::Shape::getCGAReportsBool ( ) const
pure virtual
Returns
a vector with all boolean reports from the report() operation which occured during generate().

◆ getCGAReportsFloat()

virtual const ReportFloatVect& prtx::Shape::getCGAReportsFloat ( ) const
pure virtual
Returns
a vector with all float reports from the report() operation which occured during generate().

◆ getCGAReportsString()

virtual const ReportStringVect& prtx::Shape::getCGAReportsString ( ) const
pure virtual
Returns
a vector with all string reports from the report() operation which occurred during generate().

◆ getGeometry()

virtual GeometryPtr prtx::Shape::getGeometry ( ) const
pure virtual

Returns the shape's geometry. The coordinate system is arbitrary; in order to transform the geometry into the world coordinate system, the bounding box of the geometry, the shape's pivot and scope and the initial shape's origin need to be taken in account.

See also
ShapeUtils::getGeometryToWorldTrafo()
Returns
the shape's geometry.

◆ getID()

virtual uint32_t prtx::Shape::getID ( ) const
pure virtual
Returns
the unique, nonzero ID of the shape.

◆ getMaterial()

virtual MaterialPtr prtx::Shape::getMaterial ( ) const
pure virtual

Returns the shape's material. This is the material which can be manipulated within CGA rules. Note that the shape's geometry also has a Material. In order to find the "final Material", the two materials need to be combined as follows: (1) take the geometry's material (2) every attribute which got set during generate(): override the value with the ine from the shape's material.

See also
ShapeUtils::combineMaterials()
Returns
the shape's material.

◆ getParentID()

virtual uint32_t prtx::Shape::getParentID ( ) const
pure virtual
Returns
the ID of the parent shape, 0 for the root node.

◆ getShapeSymbol()

virtual int64_t prtx::Shape::getShapeSymbol ( ) const
pure virtual

Every shape has a shape symbol which correspondents to a cga rule in the initial shape's rule file. Use the functions in ShapeUtils to turn it into human readable strings.

See also
ShapeUtils::getRuleArguments(), ShapeUtils::getRuleName(), ShapeUtils::getRuleParameters(), ShapeUtils::getStyledRuleName(), ShapeUtils::getStyledRuleSignature()
Returns
the shape's shape symbol.

◆ getTrimPlanes()

virtual const TrimPlanePtrVector& prtx::Shape::getTrimPlanes ( ) const
pure virtual

Note: trim planes are in pivot coordinates. In order to transform the geometry into the world coordinate system, the bounding box of the geometry, the shape's pivot and the initial shape's origin need to be taken in account.

See also
ShapeUtils::getPivotToWorldTrafo
Returns
a vector with all trim planes.

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