VPTissue Reference Manual
SimPT_Editor::EditControlLogic Class Reference

Class for the composition of a tissue, containing its properties. More...

#include <EditControlLogic.h>

Inheritance diagram for SimPT_Editor::EditControlLogic:
Inheritance graph
Collaboration diagram for SimPT_Editor::EditControlLogic:
Collaboration graph

Signals

void Modified ()
 Emitted when data has been modified.
 
void Moved (Node *node, double x, double y)
 Emitted when the given node has been moved to the given coordinates. More...
 
void SelectionChanged ()
 Emitted when selection has changed.
 
void StatusInfoChanged (const std::string &info)
 Emitted when certain info about the logic has changed. More...
 
void StoppedMoving ()
 Emitted when data has been modified.
 

Public Member Functions

 EditControlLogic (unsigned int chemical_count)
 Constructs a default tissue, which is an upward triangle. More...
 
 EditControlLogic (const boost::property_tree::ptree &pt)
 Constructs a tissue from a ptree. More...
 
virtual ~EditControlLogic ()
 Destructor.
 
void ChangeAttributes (const boost::property_tree::ptree &pt)
 Change the attributes of the selected items to the attributes in the given ptree. More...
 
void CopyAttributes (const boost::property_tree::ptree &pt)
 Copy the given attributes to the selected cells.
 
CellCreateCell (Node *node1, Node *node2, const QPointF &newPoint)
 See EditableMesh::CreateCell for more information.
 
bool DeleteCell (Cell *cell)
 Delete the given cell in the mesh. More...
 
void DeleteCells (const std::list< Cell * > &cells)
 Delete the given cells in the mesh. More...
 
bool DeleteNode (Node *node)
 Delete the given node in the mesh. More...
 
void Deselect ()
 Deselect the selected items.
 
const std::vector< Cell * > & GetCells () const
 Get all cells.
 
EditableMeshGetMesh ()
 Get the mesh.
 
const std::vector< Node * > & GetNodes () const
 Get all nodes.
 
const boost::property_tree::ptree & GetParameters () const
 
const std::vector< Wall * > & GetWalls () const
 Get all walls.
 
bool MoveNode (Node *node, double x, double y)
 See EditableMesh::DisplaceCell for more information.
 
void ReplaceCell (Cell *cell, std::list< QPolygonF > newCells)
 See EditableMesh::ReplaceCell for more information.
 
void SelectCells (const std::list< Cell * > &cells)
 Select the given cells.
 
const std::list< Cell * > & SelectedCells () const
 Get the selected cells.
 
void SelectEdges (const std::list< Edge > &edges)
 Select the given edges.
 
const std::list< Node * > & SelectedNodes () const
 Get the selected nodes.
 
const std::list< Wall * > & SelectedWalls () const
 Get the selected walls.
 
void SelectNodes (const std::list< Node * > &nodes)
 Select the given nodes.
 
void SetParameters (const boost::property_tree::ptree &)
 Set parameters ptree.
 
std::vector< Cell * > SplitCell (Cell *cell, Node *node1, Node *node2, bool modified=false)
 See EditableMesh::SplitCell for more information.
 
std::vector< Cell * > SplitCell (Node *node1, Node *node2)
 See EditableMesh::SplitCell for more information.
 
NodeSplitEdge (const Edge &edge)
 Split a given edge at the center. More...
 
void StopMoveNode ()
 Stop moving a node after moving it.
 
const boost::property_tree::ptree & ToPTree ()
 Get the PTree associated with the mesh.
 

Detailed Description

Class for the composition of a tissue, containing its properties.

Definition at line 47 of file EditControlLogic.h.

Constructor & Destructor Documentation

SimPT_Editor::EditControlLogic::EditControlLogic ( unsigned int  chemical_count)

Constructs a default tissue, which is an upward triangle.

Parameters
chemical_countThe chemical count of the mesh.

Definition at line 49 of file EditControlLogic.cpp.

SimPT_Editor::EditControlLogic::EditControlLogic ( const boost::property_tree::ptree &  pt)

Constructs a tissue from a ptree.

Parameters
ptPtree containing parameters and mesh subtrees.
Exceptions
ptree_errorWhen ptree doesn't contain a valid tissue.

Member Function Documentation

void SimPT_Editor::EditControlLogic::ChangeAttributes ( const boost::property_tree::ptree &  pt)

Change the attributes of the selected items to the attributes in the given ptree.

The values that should not be changed, should be marked with a '?'.

Definition at line 113 of file EditControlLogic.cpp.

References Modified().

bool SimPT_Editor::EditControlLogic::DeleteCell ( Cell cell)

Delete the given cell in the mesh.

A cell can only be deleted if it's at the boundary of the mesh.

Parameters
cellThe given cell.
Returns
True if the cell can be deleted.

Definition at line 185 of file EditControlLogic.cpp.

References DeleteCells().

Here is the call graph for this function:

void SimPT_Editor::EditControlLogic::DeleteCells ( const std::list< Cell * > &  cells)

Delete the given cells in the mesh.

The mesh should stay consistent, so use this function with caution.

Parameters
cellsThe cells that will be deleted.

Definition at line 196 of file EditControlLogic.cpp.

References SimPT_Editor::EditableMesh::DeleteCells(), Deselect(), and Modified().

Referenced by DeleteCell().

Here is the call graph for this function:

Here is the caller graph for this function:

bool SimPT_Editor::EditControlLogic::DeleteNode ( Node node)

Delete the given node in the mesh.

A node can only be deleted if it is part of cells with more than three corners and when it only is part of two edges.

Parameters
nodeThe given node.
Returns
True if the node can be deleted.

Definition at line 204 of file EditControlLogic.cpp.

References SimPT_Editor::EditableMesh::DeleteTwoDegreeNode(), Deselect(), and Modified().

Here is the call graph for this function:

void SimPT_Editor::EditControlLogic::Moved ( Node node,
double  x,
double  y 
)
signal

Emitted when the given node has been moved to the given coordinates.

Parameters
nodeThe given node
xThe x-coordinate.
yThe y-coordinate.

Referenced by MoveNode().

Here is the caller graph for this function:

Node * SimPT_Editor::EditControlLogic::SplitEdge ( const Edge edge)

Split a given edge at the center.

Parameters
edgeThe given edge.
Returns
The newly created node at the middle of the edge.

Definition at line 350 of file EditControlLogic.cpp.

References Modified(), and SimPT_Editor::EditableMesh::SplitEdge().

Here is the call graph for this function:

void SimPT_Editor::EditControlLogic::StatusInfoChanged ( const std::string &  info)
signal

Emitted when certain info about the logic has changed.

This includes the IDs of the selected items.

Parameters
infoThe information in string form.

Referenced by Deselect(), SelectCells(), SelectEdges(), and SelectNodes().

Here is the caller graph for this function:


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