Namespaces

 Text
 

Classes

struct  ClipRegion
 Clip region will trim hatching pattern. More...
 
struct  HatchingStyle
 Defines how to handle hatching (gap between lines, orientation). More...
 
struct  LineStroke
 Denotes line thickness and end caps. More...
 
struct  TessellationConfig
 Configures tessellation quality. More...
 

Enumerations

enum  LineCap { LineCap::None, LineCap::Round }
 Denotes a line's end cap. More...
 

Functions

SC_API bool CreateEllipticalArc (TessellationConfig const &config, float x_radius, float y_radius, float x_axis_rotation_radians, bool large_arc_flag, bool sweep_flag, bool invert_y, float begin_x_pos, float begin_y_pos, float end_x_pos, float end_y_pos, std::vector< Point > &out_points)
 
SC_API bool CreateHatchingPattern (Model &model, std::vector< ClipRegion > const &localSpaceClipRegions, std::vector< HatchingStyle > const &hatchingStyles, Matrix3d const &worldMatrix, MaterialKey material, bool visibility, InstanceKey &instanceKey)
 
SC_API bool CreatePointMeshes (Model &model, Point const *points, RGBA32 const *rgba32s, size_t count, MeshKeys &mesh_keys)
 
SC_API bool CreateTexturedQuad (Model &model, ImageKey textureKey, float xPos, float yPos, float width, float height, Matrix3d const &worldMatrix, bool visibility, InstanceKey &instanceKey)
 
SC_API bool CreateThickLine (TessellationConfig const &config, LineStroke const &stroke, std::vector< Point > const &path, std::vector< Point > &out_points, std::vector< uint32_t > &out_triangle_indices)
 
SC_API bool TriangulateFace (SC::Store::Point const *points, int const *face_list, size_t face_list_count, SC::Store::Point const &normal, std::vector< SC::Store::Point > &out_points)
 

Enumeration Type Documentation

◆ LineCap

Denotes a line's end cap.

Enumerator
None 
Round 

Function Documentation

◆ CreateEllipticalArc()

SC_API bool SC::Store::Utils::CreateEllipticalArc ( TessellationConfig const &  config,
float  x_radius,
float  y_radius,
float  x_axis_rotation_radians,
bool  large_arc_flag,
bool  sweep_flag,
bool  invert_y,
float  begin_x_pos,
float  begin_y_pos,
float  end_x_pos,
float  end_y_pos,
std::vector< Point > &  out_points 
)

Generates the points for the path along an elliptical arc. Ignores z-coordinates. Generated z-coordinates are set to zero. The arguments and behavior are that of SVG elliptical arcs: https://www.w3.org/TR/SVG/paths.html#PathDataEllipticalArcCommands

Returns
Returns true if the operation succeeded. Otherwise it returns false.
Parameters
configConfigures tessellation.
x_radiusThe radius of the ellipse along the x-axis
y_radiusThe radius of the ellipse along the y-axis
x_axis_rotation_radiansRotates the generated ellipse along the x-axis by this many radians.
large_arc_flagControls whether or not the generated arc is generated as a large arc.
sweep_flagIf true, the generated arc is swept in the positive angle direction. Otherwise it is swept in the negative direction.
invert_yDenotes whether or not the Y-axis is inverted.
begin_x_posThe x-coordinate of the arc's begin position
begin_y_posThe y-coordinate of the arc's begin position
end_x_posThe x-coordinate of the arc's end position
end_y_posThe y-coordinate of the arc's end position
out_pointsWhere the generate arc's points get returned.

◆ CreateHatchingPattern()

SC_API bool SC::Store::Utils::CreateHatchingPattern ( Model model,
std::vector< ClipRegion > const &  localSpaceClipRegions,
std::vector< HatchingStyle > const &  hatchingStyles,
Matrix3d const &  worldMatrix,
MaterialKey  material,
bool  visibility,
InstanceKey instanceKey 
)

Creates a hatching zone.

Parameters
model(in) SC model file to generate hatching into.
localSpaceClipRegions(in) hatching limits in local space.
hatchingStyles(in) defines hatching style (orientation, gap between lines).
worldMatrix(in) world space matrix (will be applied on the localSpaceClipRegions).
material(in) line material to use.
visibility(in) tells if hatching will be visible or not.
instanceKey(out) stream cache instance key of the resulting hatching.
Returns
true if all went right, false otherwise.

◆ CreatePointMeshes()

SC_API bool SC::Store::Utils::CreatePointMeshes ( Model model,
Point const *  points,
RGBA32 const *  rgba32s,
size_t  count,
MeshKeys mesh_keys 
)

Creates point meshes for a set of points.

Parameters
model(in) SC model file to generate point meshes into.
points(in) Points to process
rgba32s(in) Colors to process maybe nullptr. If provided must be per-point.
count(in) Number of points to process
mesh_keys(out) Resulting mesh keys.
Returns
true if all went right, false otherwise.

◆ CreateTexturedQuad()

SC_API bool SC::Store::Utils::CreateTexturedQuad ( Model model,
ImageKey  textureKey,
float  xPos,
float  yPos,
float  width,
float  height,
Matrix3d const &  worldMatrix,
bool  visibility,
InstanceKey instanceKey 
)

Creates a textured quad.

Parameters
model(in) SC model file to generate quad into.
textureKey(in) SC key of the texture
xPos(in) left local position of the quad
yPos(in) bottom local position of the quad
width(in) width of the quad
height(in) height of the quad
worldMatrix(in) world space matrix
visibility(in) tells if the quad will be visible or not.
instanceKey(out) stream cache instance key of the resulting quad.
Returns
true if all went right, false otherwise.

◆ CreateThickLine()

SC_API bool SC::Store::Utils::CreateThickLine ( TessellationConfig const &  config,
LineStroke const &  stroke,
std::vector< Point > const &  path,
std::vector< Point > &  out_points,
std::vector< uint32_t > &  out_triangle_indices 
)

Generates the points and triangles for a thick line. Ignores z-coordinates. Generated z-coordinates are set to zero.

Returns
Returns true if the operation succeeded. Otherwise it returns false.
Parameters
configConfigures tessellation.
strokeConfigures stroke properties of the generated thick line.
pathThe path used to define the spine of the thick line.
out_pointsGenerated points are returned here.
out_triangle_indicesGenerated triangle indices are returned here.

◆ TriangulateFace()

SC_API bool SC::Store::Utils::TriangulateFace ( SC::Store::Point const *  points,
int const *  face_list,
size_t  face_list_count,
SC::Store::Point const &  normal,
std::vector< SC::Store::Point > &  out_points 
)

Triangulates a supplied polygonal face.

Returns
Returns true if successful. Returns false otherwise.
Parameters
pointsThe points used by the supplied face list for specifying face vertices.
face_listA list of indices that refer to the supplied points. These indices denote the face to triangulate. An unclosed face list loop will automatically be closed by the triangulator.
face_list_countThe number of indices used in the supplied face list.
normalThe normal of the face to triangulate.
out_pointsThe vertices of the generated triangles get emitted here.