Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
SPMeshPatchI Class Reference

#include <sp-mesh-array.h>

Public Member Functions

 SPMeshPatchI (std::vector< std::vector< SPMeshNode * > > *n, int r, int c)
 
Geom::Point getPoint (unsigned side, unsigned point)
 Returns point for side in proper order for patch.
 
std::vector< Geom::PointgetPointsForSide (unsigned i)
 Returns vector of points for a side in proper order for a patch (clockwise order).
 
void setPoint (unsigned side, unsigned point, Geom::Point const &p, bool set=true)
 Set point for side in proper order for patch.
 
char getPathType (unsigned i)
 Get path type for side (stored in handle nodes).
 
void setPathType (unsigned, char t)
 Set path type for side (stored in handle nodes).
 
Geom::Point getTensorPoint (unsigned i)
 Return tensor control point for "corner" i.
 
void setTensorPoint (unsigned i, Geom::Point const &p)
 Set tensor control point for "corner" i.
 
bool tensorIsSet ()
 Return if any tensor control point is set.
 
bool tensorIsSet (unsigned i)
 
Geom::Point coonsTensorPoint (unsigned i)
 Find default tensor point (equivalent point to Coons Patch).
 
void updateNodes ()
 Update default values for handle and tensor nodes.
 
std::optional< Inkscape::Colors::ColorgetColor (unsigned i)
 Return color for corner of patch.
 
void setColor (unsigned i, Inkscape::Colors::Color const &c)
 Set color for corner of patch.
 
SPStopgetStopPtr (unsigned i)
 Return stop pointer for corner of patch.
 
void setStopPtr (unsigned i, SPStop *)
 Set stop pointer for corner of patch.
 

Private Attributes

std::vector< std::vector< SPMeshNode * > > * nodes
 
int row
 
int col
 

Detailed Description

Definition at line 111 of file sp-mesh-array.h.

Constructor & Destructor Documentation

◆ SPMeshPatchI()

SPMeshPatchI::SPMeshPatchI ( std::vector< std::vector< SPMeshNode * > > *  n,
int  r,
int  c 
)

Definition at line 79 of file sp-mesh-array.cpp.

References c, col, MG_NODE_TYPE_CORNER, MG_NODE_TYPE_HANDLE, MG_NODE_TYPE_TENSOR, node, nodes, row, and size.

Member Function Documentation

◆ coonsTensorPoint()

Geom::Point SPMeshPatchI::coonsTensorPoint ( unsigned  i)

Find default tensor point (equivalent point to Coons Patch).

Formulas defined in PDF spec. Equivalent to 1/3 of side length from corner for square patch.

Definition at line 355 of file sp-mesh-array.cpp.

References getPoint().

Referenced by getTensorPoint(), and updateNodes().

◆ getColor()

std::optional< Inkscape::Colors::Color > SPMeshPatchI::getColor ( unsigned  i)

Return color for corner of patch.

Definition at line 472 of file sp-mesh-array.cpp.

References col, nodes, and row.

Referenced by SPMeshNodeArray::write().

◆ getPathType()

char SPMeshPatchI::getPathType ( unsigned  i)

Get path type for side (stored in handle nodes).

Definition at line 191 of file sp-mesh-array.cpp.

References col, and row.

Referenced by SPMeshNodeArray::write().

◆ getPoint()

Geom::Point SPMeshPatchI::getPoint ( unsigned  side,
unsigned  point 
)

Returns point for side in proper order for patch.

Definition at line 110 of file sp-mesh-array.cpp.

References col, and row.

Referenced by GrDrag::addStopNearPoint(), coonsTensorPoint(), getPointsForSide(), SPMeshNodeArray::read(), and SPMeshNodeArray::write().

◆ getPointsForSide()

std::vector< Geom::Point > SPMeshPatchI::getPointsForSide ( unsigned  i)

Returns vector of points for a side in proper order for a patch (clockwise order).

Definition at line 135 of file sp-mesh-array.cpp.

References getPoint().

Referenced by GrDrag::updateLines(), and SPMeshNodeArray::write().

◆ getStopPtr()

SPStop * SPMeshPatchI::getStopPtr ( unsigned  i)

Return stop pointer for corner of patch.

Definition at line 515 of file sp-mesh-array.cpp.

References col, and row.

◆ getTensorPoint()

Geom::Point SPMeshPatchI::getTensorPoint ( unsigned  k)

Return tensor control point for "corner" i.

If not set, returns calculated (Coons) point.

Definition at line 314 of file sp-mesh-array.cpp.

References col, coonsTensorPoint(), nodes, row, and set.

Referenced by SPMeshNodeArray::write().

◆ setColor()

void SPMeshPatchI::setColor ( unsigned  i,
Inkscape::Colors::Color const &  c 
)

Set color for corner of patch.

Definition at line 492 of file sp-mesh-array.cpp.

References col, and row.

Referenced by SPMeshNodeArray::create(), and SPMeshNodeArray::read().

◆ setPathType()

void SPMeshPatchI::setPathType ( unsigned  s,
char  t 
)

Set path type for side (stored in handle nodes).

Definition at line 218 of file sp-mesh-array.cpp.

References col, and row.

Referenced by SPMeshNodeArray::create(), and SPMeshNodeArray::read().

◆ setPoint()

void SPMeshPatchI::setPoint ( unsigned  side,
unsigned  point,
Geom::Point const &  p,
bool  set = true 
)

Set point for side in proper order for patch.

Definition at line 150 of file sp-mesh-array.cpp.

References col, MG_NODE_TYPE_CORNER, MG_NODE_TYPE_HANDLE, row, and set.

Referenced by SPMeshNodeArray::create(), and SPMeshNodeArray::read().

◆ setStopPtr()

void SPMeshPatchI::setStopPtr ( unsigned  i,
SPStop stop 
)

Set stop pointer for corner of patch.

Definition at line 541 of file sp-mesh-array.cpp.

References col, and row.

Referenced by SPMeshNodeArray::read().

◆ setTensorPoint()

void SPMeshPatchI::setTensorPoint ( unsigned  i,
Geom::Point const &  p 
)

Set tensor control point for "corner" i.

Definition at line 245 of file sp-mesh-array.cpp.

References col, MG_NODE_TYPE_TENSOR, and row.

Referenced by SPMeshNodeArray::read().

◆ tensorIsSet() [1/2]

bool SPMeshPatchI::tensorIsSet ( )

Return if any tensor control point is set.

Definition at line 276 of file sp-mesh-array.cpp.

References tensorIsSet().

Referenced by SPMeshNodeArray::tensor_toggle(), tensorIsSet(), and SPMeshNodeArray::write().

◆ tensorIsSet() [2/2]

bool SPMeshPatchI::tensorIsSet ( unsigned  i)

◆ updateNodes()

void SPMeshPatchI::updateNodes ( )

Update default values for handle and tensor nodes.

Definition at line 417 of file sp-mesh-array.cpp.

References col, coonsTensorPoint(), MG_NODE_TYPE_HANDLE, MG_NODE_TYPE_TENSOR, nodes, row, and set.

Referenced by SPMeshNodeArray::create(), and SPMeshNodeArray::tensor_toggle().

Member Data Documentation

◆ col

◆ nodes

std::vector<std::vector< SPMeshNode* > >* SPMeshPatchI::nodes
private

Definition at line 113 of file sp-mesh-array.h.

Referenced by getColor(), getTensorPoint(), SPMeshPatchI(), and updateNodes().

◆ row


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