Sequence Chart Studio  svn HEAD revision
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Static Public Member Functions | Static Private Member Functions | List of all members
CPageUtils Class Reference

#include <pageutils.h>

Collaboration diagram for CPageUtils:
Collaboration graph

Static Public Member Functions

static short GetPageUnits (Visio::IVPagePtr vsoPage)
 
static double ConvertUnits (Visio::IVPagePtr vsoPage, double value, int unitsFrom=visPageUnits, int unitsTo=0)
 
static double ConvertUnits (Visio::IVApplicationPtr vsoApp, double value, int unitsFrom=visPageUnits, int unitsTo=0)
 
static double GetPageWidth (Visio::IVPagePtr vsoPage, int units=visPageUnits)
 
static double GetPageHeight (Visio::IVPagePtr vsoPage, int units=visPageUnits)
 
static const LPCTSTR VisioUnitToString (short unitCode)
 
static Visio::IVSelectionPtr FilterSelection (Visio::IVSelectionPtr selection, TShapeType shapeType)
 
static MscPointgetIntersectionPoint (const MscPoint &p1, const MscPoint &p2, const MscPoint &p3, const MscPoint &p4)
 
static double GetOriginGridX (Visio::IVPagePtr vsoPage, int units=visPageUnits)
 
static double GetOriginGridY (Visio::IVPagePtr vsoPage, int units=visPageUnits)
 
static MscPoint getNormalVec (const MscPoint &origVector, double newVectorSize)
 
static void changeLineWeights (Visio::IVPagePtr vsoPage, double step)
 

Static Private Member Functions

static void setShapeLineWeights (Visio::IVShapesPtr shapes, double weight)
 

Detailed Description

A utility class for functionality on a Visio Page.

Definition at line 26 of file pageutils.h.

Member Function Documentation

void CPageUtils::changeLineWeights ( Visio::IVPagePtr  vsoPage,
double  step 
)
static

Increases or decreases the line weights by a given step.

If all the shapes have the same line weights, it increases the line weights of all shapes by the step. If there are some shapes with thicker (or thinner, if step is negative) lines, they are set to have line weights the same as the thickest (or thinnest, respectively) lines.

Parameters
vsoPagepage to change the line weights on
stepstep by which to increase the weights (in internal units = inches; may be negative)

Definition at line 177 of file pageutils.cpp.

References EPSILON, and setShapeLineWeights().

Referenced by CDocumentMonitor::OnMenuThickenLines(), and CDocumentMonitor::OnMenuThinLines().

double CPageUtils::ConvertUnits ( Visio::IVPagePtr  vsoPage,
double  value,
int  unitsFrom = visPageUnits,
int  unitsTo = 0 
)
static

Converts a value between specified units.

Parameters
vsoPagethe document page in which to convert the units
valuethe value to be converted
unitsFromfrom which units to convert; use VisUnitCodes constants or 0 for Visio's internal units
unitsToto which units to convert; use VisUnitCodes constants or 0 for Visio's internal units
Returns
value converted from unitsFrom to unitsTo

Definition at line 28 of file pageutils.cpp.

Referenced by CInstancesFieldDlg::CInstancesFieldDlg(), CMessageSequenceDlg::CMessageSequenceDlg(), ConvertUnits(), CStudioAddon::DoInstancesField(), CStudioAddon::HandleCoordinatesChanged(), CInstancesFieldDlg::OnDefaultCmd(), CDocumentMonitor::OnDropShape(), CDocumentMonitor::OnMenuMessageSequence(), and CShapeUtils::setCoregionWidth().

static double CPageUtils::ConvertUnits ( Visio::IVApplicationPtr  vsoApp,
double  value,
int  unitsFrom = visPageUnits,
int  unitsTo = 0 
)
inlinestatic

Converts a value between specified units.

Parameters
vsoAppthe application in which to convert the units - it uses its current page
valuethe value to be converted
unitsFromfrom which units to convert; use VisUnitCodes constants or 0 for Visio's internal units
unitsToto which units to convert; use VisUnitCodes constants or 0 for Visio's internal units
Returns
value converted from unitsFrom to unitsTo

Definition at line 54 of file pageutils.h.

References ConvertUnits().

Visio::IVSelectionPtr CPageUtils::FilterSelection ( Visio::IVSelectionPtr  selection,
TShapeType  shapeType 
)
static

Filters out all shapes from a given selection which are not of a given type.

Parameters
selectionthe selection to be filtered
shapeType
Returns
a new selection consisting only of shapes of the given type

Definition at line 135 of file pageutils.cpp.

References get_shape_type().

Referenced by CDocumentMonitor::getInstancesInBetween(), and CDocumentMonitor::getInstancesPair().

MscPoint * CPageUtils::getIntersectionPoint ( const MscPoint p1,
const MscPoint p2,
const MscPoint p3,
const MscPoint p4 
)
static

Returns intersection point between two vectors represented by 4 points

Parameters
p1endpoint of the first line
p2beginpoint of the first line
p3endpoint of the second line
p4beginpoint of the second line

Definition at line 149 of file pageutils.cpp.

References MscPoint::get_x(), and MscPoint::get_y().

Referenced by CMessageSnapping::getIntersectionWithCoregion(), and CMessageSnapping::getIntersectionWithInstance().

MscPoint CPageUtils::getNormalVec ( const MscPoint origVector,
double  newVectorSize 
)
static
static double CPageUtils::GetOriginGridX ( Visio::IVPagePtr  vsoPage,
int  units = visPageUnits 
)
static
static double CPageUtils::GetOriginGridY ( Visio::IVPagePtr  vsoPage,
int  units = visPageUnits 
)
static
double CPageUtils::GetPageHeight ( Visio::IVPagePtr  vsoPage,
int  units = visPageUnits 
)
static

Retrieves height of a given page.

Parameters
vsoPagethe page which to get height of
unitsunits in which to retrieve the result; use VisUnitCodes constants or 0 for Visio's internal units; the default are units of the given page
Returns
height of the page in units

Definition at line 61 of file pageutils.cpp.

Referenced by CInstancesFieldDlg::CInstancesFieldDlg(), CMessageSequenceDlg::CMessageSequenceDlg(), CStudioAddon::DoInstancesField(), CDocumentMonitor::DrawInstancesField(), and CStudioAddon::HandleCoordinatesChanged().

short CPageUtils::GetPageUnits ( Visio::IVPagePtr  vsoPage)
static

Returns measurement units of a Visio page.

Returns
VisUnitCodes unit code of units of the given page

Definition at line 23 of file pageutils.cpp.

Referenced by CInstancesFieldDlg::CInstancesFieldDlg(), and CMessageSequenceDlg::CMessageSequenceDlg().

double CPageUtils::GetPageWidth ( Visio::IVPagePtr  vsoPage,
int  units = visPageUnits 
)
static

Retrieves width of a given page.

Parameters
vsoPagethe page which to get width of
unitsunits in which to retrieve the result; use VisUnitCodes constants or 0 for Visio's internal units; the default are units of the given page
Returns
width of the page in units units

Definition at line 55 of file pageutils.cpp.

Referenced by CInstancesFieldDlg::CInstancesFieldDlg(), CDocumentMonitor::DrawInstancesField(), and CStudioAddon::HandleCoordinatesChanged().

void CPageUtils::setShapeLineWeights ( Visio::IVShapesPtr  shapes,
double  weight 
)
staticprivate

Definition at line 213 of file pageutils.cpp.

Referenced by changeLineWeights().

const LPCTSTR CPageUtils::VisioUnitToString ( short  unitCode)
static

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

SourceForge.net Logo
Generated on Fri Jan 15 2016 16:26:58 for Sequence Chart Studio by  doxygen