BrepAttachment
The BrepAttachment class represents an attachment that can be associated with a brep node in a 3D scene. It supports various attachment types, including lights and cameras, allowing for flexible scene composition. The class provides methods for setting and retrieving the attachment type, name, associated node, and parameters. Each attachment can have custom parameters, such as boolean flags, scalar values, vectors, and colors, which can be added, accessed, and modified.
#include <format/TellusimBrep.h>
Constructors
explicit BrepAttachment(const char *name = nullptr)
explicit BrepAttachment(Type type, const char *name = nullptr)
explicit BrepAttachment(BrepNode &node, const char *name = nullptr)
Methods
Clear attachment.
void clear()
Attachment type.
void setType(Type type)
Type getType() const
static const char *getTypeName(Type type)
const char *getTypeName() const
bool isUnknown() const
bool isLight() const
bool isCamera() const
Attachment name.
void setName(const char *name)
String getName() const
Attachment node.
void setNode(BrepNode &node, bool check = true)
const BrepNode getNode() const
BrepNode getNode()
Attachment data.
void setData(const char *data)
void setData(const String &data)
String getData() const
Attachment parameters.
void clearParameters()
bool removeParameter(const char *type)
void copyParameters(const BrepAttachment &attachment)
uint32_t findParameter(const char *type) const
bool hasParameter(const char *type) const
uint32_t getNumParameters() const
String getParameterType(uint32_t index) const
Add attachment parameters.
void addParameter(const char *type, bool value)
void addParameter(const char *type, float32_t value)
void addParameter(const char *type, Vector4f vector)
void addParameter(const char *type, Color color)
void addParameter(const char *type, const char *name)
void addParameter(const char *type, const String &name)
Get attachment parameter by index.
Flags getParameterFlags(uint32_t index) const
bool hasParameterFlag(uint32_t index, Flags flags) const
bool hasParameterFlags(uint32_t index, Flags flags) const
bool getParameterBool(uint32_t index, bool value = false) const
float32_t getParameterScalarf32(uint32_t index, float32_t value = 0.0f) const
const Vector4f getParameterVector4f(uint32_t index, Vector4f vector = Vector4f::zero) const
const Color getParameterColor(uint32_t index, Color color = Color::white) const
String getParameterName(uint32_t index, const String &name = String::null) const
Get attachment parameter by type.
Flags getParameterFlags(const char *type) const
bool hasParameterFlag(const char *type, Flags flags) const
bool hasParameterFlags(const char *type, Flags flags) const
bool getParameterBool(const char *type, bool value = false) const
float32_t getParameterScalarf32(const char *type, float32_t value = 0.0f) const
const Vector4f getParameterVector4f(const char *type, Vector4f vector = Vector4f::zero) const
const Color getParameterColor(const char *type, Color color = Color::white) const
String getParameterName(const char *type, const String &name = String::null) const
Attachment transform.
void setTransform(float64_t scale)
void setTransform(Matrix4x3d transform)
const Matrix4x3d getTransform() const
Compare attachments.
int32_t compare(const BrepAttachment &attachment) const
Memory usage.
size_t getMemory() const
Enums
Type
Attachment types.
Name | Value | Description |
---|---|---|
TypeUnknown | 0 | |
TypeLightGlobal | 1 | Global light. |
TypeLightPoint | 2 | Point light. |
TypeLightSpot | 3 | Spot light. |
TypeCameraPerspective | 4 | Perspective camera. |
TypeCameraOrthographic | 5 | Orthographic camera. |
NumTypes | 6 |
Flags
Attachment flags.
Name | Value | Description |
---|---|---|
FlagNone | 0 | |
FlagBool | (1 << 0) | Boolean parameter flag. |
FlagScalarf32 | (1 << 1) | Scalar parameter flag. |
FlagVector4f | (1 << 2) | Vector parameter flag. |
FlagColor | (1 << 3) | Color parameter flag. |
FlagName | (1 << 4) | Name parameter flag. |
Variables
Type | Name | Description |
---|---|---|
static const char* | TypeColor | Light parameter types. |
static const char* | TypeIntensity | |
static const char* | TypeInnerAngle | |
static const char* | TypeOuterAngle | |
static const char* | TypeAttenuation | |
static const char* | TypeRadius | |
static const char* | TypeShadow | |
static const char* | TypeAspect | Camera parameter types. |
static const char* | TypeFovX | |
static const char* | TypeFovY | |
static const char* | TypeSizeX | |
static const char* | TypeSizeY | |
static const char* | TypeZNear | |
static const char* | TypeZFar |