class M_Shape

The M_Shape class represents a visible shape in Moho. A shape can either be a fill, an outline, or both.

Member Functions

int CountEdges()

Returns the number of edges that make up this shape.

Return value (int): -- the number of edges that make up this shape

void GetEdge(edgeID, curveID, segID)

Returns information about a specific edge. Given an edge on the shape, this function returns the curve id and segment id of the actual curve in the underlying mesh.

Return value: none
edgeID (int): the id number of the edge (0 for the first edge in a shape)
curveID (int): curve id
segID (int): which segment of the curve is this edge

void CopyStyleProperties(fromShape)

Copies the style properties from another shape.

Return value: none
fromShape (M_Shape): shape to copy from

void RemoveStyles()

Removes all inherited styles from the shape.

Return value: none

Member Variables

fSelected (bool)

True if the shape is selected, otherwise false.


fName (LM_String)

Name of the shape.


fHasFill (bool)

True if the shape is filled, otherwise false.


fHasOutline (bool)

True if the shape has an outline, otherwise false.


fFillAllowed (bool)

True if a fill is allowed, whether the shape actually has a fill or not.


fMyStyle (M_Style)

The shape's style properties. The style defines a shape's fill color, line width, etc.

class M_Shape {
  const char *Name();
  void SetName(const char *name);
  int32 GetNumEdges @ CountEdges();
  void GetEdge(int32 edgeID, int32 *curveID, int32 *segID);
  bool ContainsEdge(int32 curveID, int32 segID);
  bool ContainsPoint(int32 pointID);
 
  bool AllPointsSelected();
  void ShapeBounds(LM_Vector2 *min, LM_Vector2 *max);
  void ShapeBounds(LM_Vector2 *min, LM_Vector2 *max, int32 frame);
  LM_Vector2 ShapeCenter();
  LM_Vector2 EffectHandle1();
  LM_Vector2 EffectHandle2();
  void CopyStyleProperties(M_Shape *fromShape, bool skipFill = false, bool skipLine = false);
  void RemoveStyles();
  void MakePlain();
  bool HasPositionDependentStyles();
 
  bool    fSelected;
  bool    fHidden;
 
  LM_String  fName;
 
  bool    fHasFill;
  bool    fHasOutline;
  bool    fFillAllowed;
 
  AnimVal    fEffectScale;
  AnimVal    fEffectRotation;
  AnimVec2  fEffectOffset;
  AnimVal    f3DThickness;
 
  M_Style    fMyStyle;
  LM_String  fInheritedStyleName;
  M_Style    *fInheritedStyle;
  LM_String  fInheritedStyleName2;
  M_Style    *fInheritedStyle2;
};