VPTissue Reference Manual
SimPT_Editor::TissueGraphicsView Class Reference

The graphical view on the tissue. More...

#include <TissueGraphicsView.h>

Inheritance diagram for SimPT_Editor::TissueGraphicsView:
Inheritance graph
Collaboration diagram for SimPT_Editor::TissueGraphicsView:
Collaboration graph

Public Slots

void CancelAction ()
 Cancel the current action. More...
 
void CopyAttributes ()
 Copy attributes action (only available in CELL mode). More...
 
void CreateCell ()
 Create a cell.
 
void DeleteItem ()
 Delete the selected item.
 
void SetBackground ()
 Opens the dialog to set the background image of the workspace.
 
void SetDisplayModePreferences ()
 Set the preferences of the display mode ('NONE'). More...
 
void SetTransparentCells (bool transparent)
 Set background of cells transparent. More...
 
void SplitCell ()
 Split a cell through the selected nodes. More...
 
void SplitEdge ()
 Split the selected edge. More...
 
void UpdateMovedNode ()
 Update the moved node in the scene.
 

Signals

void ItemsSelected (unsigned int count)
 Emitted when the selection has changed. More...
 
void ModeChanged ()
 Emitted when the mode has changed. More...
 
void StatusInfoChanged (const std::string &info)
 Emitted when certain info about the view has changed. More...
 

Public Member Functions

 TissueGraphicsView (QWidget *parent)
 Constructor. More...
 
virtual ~TissueGraphicsView ()
 Destructor.
 
EditableCellItemAddCell (std::list< EditableNodeItem * > endpoints, std::list< EditableEdgeItem * > edges, SimPT_Sim::Cell *cell)
 Adds a cell to the scene. More...
 
EditableEdgeItemAddEdge (EditableNodeItem *endpoint1, EditableNodeItem *endpoint2)
 Adds an edge to the scene. More...
 
EditableNodeItemAddNode (SimPT_Sim::Node *node)
 Adds a node to the scene. More...
 
void Cleanup ()
 Cleans the scene. More...
 
void GenerateRegularPattern ()
 Generates a regular cell pattern in the selected cell.
 
void GenerateVoronoiPattern ()
 Generates a cell pattern using Voronoi Tesselation in the selected cell.
 
Mode GetMode () const
 Returns the current mode.
 
SelectByIDWidgetGetSelectByIDWidget () const
 Returns the widget for selecting items by ID.
 
void Initialize (std::shared_ptr< EditControlLogic > tissue, Mode mode=Mode::DISPLAY)
 Adds the items in the tissue to the scene. More...
 
bool SelectedIsAtBoundary () const
 Checks whether the selected (editable) items are at the boundary of the cell complex. More...
 
bool SelectedIsDeletable () const
 Checks whether the selected (editable) items are deletable. More...
 
bool SelectedIsSplitable () const
 Checks whether two selected nodes can split a single cell. More...
 
void SetColorComponent (const boost::property_tree::ptree &parameters)
 Set the colorizer map for coloring the cells in 'NONE'-mode. More...
 
void SetMode (Mode mode)
 Set the editing mode of the view. More...
 
- Public Member Functions inherited from SimShell::Gui::PanAndZoomView
 PanAndZoomView (double zoomMin=0.07, double zoomMax=100.0, QWidget *parent=nullptr)
 Constructor. More...
 
virtual ~PanAndZoomView ()
 Destructor.
 
virtual void enterEvent (QEvent *event)
 Overriding enterEvent to grab focus when the view is entered. More...
 
virtual void keyPressEvent (QKeyEvent *event)
 Overriding keyPressEvent to detect when control key is pressed. More...
 
virtual void keyReleaseEvent (QKeyEvent *event)
 Overriding releasePressEvent to detect when control key is released. More...
 
void ResetZoom ()
 Resets the view to the normal zoom level.
 
void ScaleView (double factor)
 Scales the view, bounded by the minimum and maximum zooming factor. More...
 
double Scaling ()
 Gets the current scaling of the view (assuming the view was only scaled with ScaleView() and the horizontal and vertical scaling are the same) More...
 
virtual void wheelEvent (QWheelEvent *event)
 Overriding wheelEvent to scroll the view when control key is held down. More...
 

Detailed Description

The graphical view on the tissue.

Definition at line 73 of file TissueGraphicsView.h.

Constructor & Destructor Documentation

SimPT_Editor::TissueGraphicsView::TissueGraphicsView ( QWidget parent)

Constructor.

Parameters
parentThe parent of this object.

Definition at line 66 of file TissueGraphicsView.cpp.

Member Function Documentation

EditableCellItem * SimPT_Editor::TissueGraphicsView::AddCell ( std::list< EditableNodeItem * >  endpoints,
std::list< EditableEdgeItem * >  edges,
SimPT_Sim::Cell cell 
)

Adds a cell to the scene.

The endpoints should be listed in order of connection.

Parameters
endpointsThe endpoints of the cell.
edgesThe edges of the cell.
cellThe logical representation of the cell.

Definition at line 207 of file TissueGraphicsView.cpp.

References SimPT_Editor::EditableCellItem::SetTransparent().

Referenced by Initialize().

Here is the call graph for this function:

Here is the caller graph for this function:

EditableEdgeItem * SimPT_Editor::TissueGraphicsView::AddEdge ( EditableNodeItem endpoint1,
EditableNodeItem endpoint2 
)

Adds an edge to the scene.

Remember that the order of the endpoints doesn't matter.

Parameters
endpoint1The first endpoint of the edge.
endpoint2The second endpoint of the edge.

Definition at line 216 of file TissueGraphicsView.cpp.

Referenced by Initialize().

Here is the caller graph for this function:

EditableNodeItem * SimPT_Editor::TissueGraphicsView::AddNode ( SimPT_Sim::Node node)

Adds a node to the scene.

Parameters
nodeThe logical representation of the node.

Definition at line 224 of file TissueGraphicsView.cpp.

Referenced by Initialize(), and SplitEdge().

Here is the caller graph for this function:

void SimPT_Editor::TissueGraphicsView::CancelAction ( )
slot

Cancel the current action.

(only available in CELL_CREATE and CELL_SLICE mode)

Definition at line 375 of file TissueGraphicsView.cpp.

References ItemsSelected(), and ModeChanged().

void SimPT_Editor::TissueGraphicsView::Cleanup ( )

Cleans the scene.

The background image is kept, as the scene isn't its owner.

Definition at line 353 of file TissueGraphicsView.cpp.

References SetMode().

Referenced by Initialize(), and ~TissueGraphicsView().

Here is the call graph for this function:

Here is the caller graph for this function:

void SimPT_Editor::TissueGraphicsView::CopyAttributes ( )
slot

Copy attributes action (only available in CELL mode).

The user will be asked to give a source cell and attributes. Those attributes will be copied to the selected cells.

Definition at line 416 of file TissueGraphicsView.cpp.

References SetMode().

Here is the call graph for this function:

void SimPT_Editor::TissueGraphicsView::Initialize ( std::shared_ptr< EditControlLogic tissue,
Mode  mode = Mode::DISPLAY 
)

Adds the items in the tissue to the scene.

Parameters
tissueThe given tissue.
modeThe mode which the view will be initialized with. (default = DISPLAY)

Definition at line 102 of file TissueGraphicsView.cpp.

References AddCell(), AddEdge(), AddNode(), Cleanup(), SimPT_Sim::Container::make_const_circular(), SimPT_Sim::Container::next(), SetMode(), SetTransparentCells(), StatusInfoChanged(), and UpdateMovedNode().

Referenced by GenerateRegularPattern(), GenerateVoronoiPattern(), and SplitCell().

Here is the call graph for this function:

Here is the caller graph for this function:

void SimPT_Editor::TissueGraphicsView::ItemsSelected ( unsigned int  count)
signal

Emitted when the selection has changed.

(only emitted when in a global mode [NODE, EDGE or CELL]).

Parameters
unsignedint The number of items selected.

Referenced by CancelAction().

Here is the caller graph for this function:

void SimPT_Editor::TissueGraphicsView::ModeChanged ( )
signal

Emitted when the mode has changed.

(only emitted when changed to a global mode [NODE, EDGE or CELL]).

Referenced by CancelAction(), and SetMode().

Here is the caller graph for this function:

bool SimPT_Editor::TissueGraphicsView::SelectedIsAtBoundary ( ) const

Checks whether the selected (editable) items are at the boundary of the cell complex.

Returns
True if the selected items are at the boundary.

Definition at line 144 of file TissueGraphicsView.cpp.

References SimPT_Editor::EditableItem::IsAtBoundary().

Referenced by SimPT_Editor::EditorActions::ItemsSelected().

Here is the call graph for this function:

Here is the caller graph for this function:

bool SimPT_Editor::TissueGraphicsView::SelectedIsDeletable ( ) const

Checks whether the selected (editable) items are deletable.

A cell or node is deletable if they are respectively at the boundary and of degree two in a cell with more than 3 nodes.

Returns
True if the selected items are deletable.

Definition at line 161 of file TissueGraphicsView.cpp.

References SimPT_Editor::EditableCellItem::Cell(), and SimPT_Editor::EditableNodeItem::Node().

Referenced by SimPT_Editor::EditorActions::ItemsSelected().

Here is the call graph for this function:

Here is the caller graph for this function:

bool SimPT_Editor::TissueGraphicsView::SelectedIsSplitable ( ) const

Checks whether two selected nodes can split a single cell.

This means the nodes shouldn't be directly adjacent, but still should be part of the same cell (excluding the boundary polygon).

Returns
True if the selected nodes can split a cell.

Definition at line 193 of file TissueGraphicsView.cpp.

References SimPT_Editor::EditableNodeItem::Node().

Referenced by SimPT_Editor::EditorActions::ItemsSelected().

Here is the call graph for this function:

Here is the caller graph for this function:

void SimPT_Editor::TissueGraphicsView::SetColorComponent ( const boost::property_tree::ptree &  parameters)

Set the colorizer map for coloring the cells in 'NONE'-mode.

Parameters
parametersThe parameters to initialize the colorizer map.

Definition at line 346 of file TissueGraphicsView.cpp.

References SimPT_Sim::ComponentFactoryProxy::Create().

Here is the call graph for this function:

void SimPT_Editor::TissueGraphicsView::SetDisplayModePreferences ( )
slot

Set the preferences of the display mode ('NONE').

The selected preference will determine the coloring of the cells in this mode.

Definition at line 516 of file TissueGraphicsView.cpp.

References SetMode().

Here is the call graph for this function:

void SimPT_Editor::TissueGraphicsView::SetMode ( Mode  mode)

Set the editing mode of the view.

Invariant: When the mode is set, only items of the corresponding type can be selected.

Definition at line 241 of file TissueGraphicsView.cpp.

References ModeChanged(), SimPT_Editor::SelectByIDWidget::SetMaxID(), and StatusInfoChanged().

Referenced by Cleanup(), CopyAttributes(), CreateCell(), Initialize(), and SetDisplayModePreferences().

Here is the call graph for this function:

Here is the caller graph for this function:

void SimPT_Editor::TissueGraphicsView::SetTransparentCells ( bool  transparent)
slot

Set background of cells transparent.

Parameters
transparentTrue if the cells should be transparent.

Definition at line 536 of file TissueGraphicsView.cpp.

Referenced by Initialize().

Here is the caller graph for this function:

void SimPT_Editor::TissueGraphicsView::SplitCell ( )
slot

Split a cell through the selected nodes.

(only available in NODE mode)

Definition at line 485 of file TissueGraphicsView.cpp.

References Initialize(), and SimPT_Editor::EditableNodeItem::Node().

Here is the call graph for this function:

void SimPT_Editor::TissueGraphicsView::SplitEdge ( )
slot

Split the selected edge.

(only available in EDGE mode)

Definition at line 459 of file TissueGraphicsView.cpp.

References AddNode().

Here is the call graph for this function:

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

Emitted when certain info about the view has changed.

This includes the four basic modes ('DISPLAY', 'NODE', 'EDGE', 'CELL').

Parameters
infoThe information in string form.

Referenced by Initialize(), and SetMode().

Here is the caller graph for this function:


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