Aimsun Next Scripting
22
|
Public Types | |
enum | eDPIToUse { eHorizontalDPI , eVerticalDPI } |
![]() | |
enum | GKHitModifier { eAll , eSelected , eUnselected } |
enum | GKFloatingStringRelativePos { eAuto , eCenter , eLeft , eRight , eTop , eBottom } |
Public Member Functions | |
G2DView (QWidget *, const QString &=QString()) | |
~G2DView () | |
QWidget * | getWidget () |
void | invalidate () |
void | selectAll () |
void | inverseSelection () |
void | setWorld (const GKBBox &) |
const GKBBox & | getViewArea () const |
const GKBBox & | getWorld () const |
GKBBox | minBBox () const |
GKCoord | getZoom () const |
GKPoint | screen2World (const QPointF &) const |
double | unit2Pixel (GKCoord, eDPIToUse=eHorizontalDPI) const |
GKCoord | pixel2Unit (int, eDPIToUse=eHorizontalDPI) const |
void | zoom (GKCoord) |
void | zoom (GKCoord, const GKPoint &) |
void | zoom (const GKBBox &) |
void | pan (const GKPoint &) |
void | panToObject (const GKGeoObject *) |
void | centerWorld () |
void | wholeWorld () |
void | wholeArea (const GKBBox &) |
void | moveSelectionToViewCenter () |
void | centerLayer (GKLayer *) |
virtual GDrawerHit * | findClicked (const QPointF &, GKHitModifier=eAll, bool=false) |
virtual QVector< GDrawerHit * > | multiFindClicked (const QPointF &, GKHitModifier, bool=false) |
GKGeoObject * | findClosestObject (const GKPoint &p, GKType *type=NULL, double maxDistance=100, double *objDistance=NULL) |
void | setTimeContext (const GKContext &) |
G2DViewLayer * | findLayer (GKLayer *modelLayer, bool recursive=true) |
bool | isMasterView () const |
void | setMasterView (bool) |
bool | isMasterClock () const |
void | setMasterClock (bool value) |
bool | saveSnapshot (const QString &fileName, const char *format, GKBBox area, int width=-1, int height=-1, bool includeLogos=true) |
bool | copySnapshot (int=-1, int=-1) |
void | preferencesChanged () |
void | cut () |
void | copy () |
void | paste () |
void | clear () |
int | getScreenWidth () const |
int | getScreenHeight () const |
void | setFilter (GKProblemNet *) |
void | setAttributeForDynamicLabel (GKGeoObject *object, GKColumn *newAttribute) |
![]() | |
if (base) | |
Py_END_ALLOW_THREADS End | GView (QWidget *parent=0, Qt::WindowFlags fl=Qt::WindowFlags()) |
virtual GDrawer * | findDrawer (const GKGeoObject *key) const |
virtual GDrawer * | removeDrawer (const GKGeoObject *key)=0 |
virtual void | invalidate () |
virtual const QHash< GKGeoObject *, GDrawer * > & | getDrawers () const =0 |
virtual GDrawerHit * | findClicked (const QPointF &, GKHitModifier=eAll, bool=false) |
virtual QVector< GDrawerHit * > | multiFindClicked (const QPointF &, GKHitModifier, bool=false) |
virtual GDrawerHit * | findClickedByType (const QPointF &p, GKType *type, GKHitModifier=eAll, bool=false) |
virtual void | selectAll () |
virtual void | inverseSelection () |
virtual void | populate ()=0 |
GKContext & | getTimeContext () |
void | setTimeContext (const GKContext &) |
GKViewMode * | getMode () const |
virtual void | setMode (GKViewMode *) |
virtual void | panToObject (const GKGeoObject *) |
virtual void | setFloatingString (const QString &, const GKPoint &, GKFloatingStringRelativePos=eRight) |
GGui & | getGui () |
GKGeoModel & | getGeoModel () |
GKProblemNet * | getFilter () const |
virtual void | setFilter (GKProblemNet *) |
virtual GKPoint | screen2World (const QPointF &) const =0 |
virtual bool | saveSnapshot (const QString &, const char *, GKBBox, int=-1, int=-1, bool=true) |
Static Public Attributes | |
static int | gcSimpleDrawZoomFactor |
Additional Inherited Members | |
![]() | |
ConvertToSubClassCode Py_BEGIN_ALLOW_THREADS GView * | base = (GView*)( sipCpp ) |
sipType = 0 | |
A view for 2D objects that can be integrated (but is not mandatory) in a G2DViewWindow.
enum G2DView::eDPIToUse |
G2DView::G2DView | ( | QWidget * | , |
const QString & | = QString() |
||
) |
G2DView::~G2DView | ( | ) |
void G2DView::centerLayer | ( | GKLayer * | ) |
Pan the view to the center of this layer.
void G2DView::centerWorld | ( | ) |
Centers the world (pan) in the current view
void G2DView::clear | ( | ) |
void G2DView::copy | ( | ) |
bool G2DView::copySnapshot | ( | int | = -1 , |
int | = -1 |
||
) |
void G2DView::cut | ( | ) |
|
virtual |
Find an object (and only object) in where the point dp its interior to it. The modifier can be used to look only on:
Also an additional parameter to extend the search to non_editable layers can be specified.
This method stops when it founds the first suitable object. On a 2D View the layer order is used (top layers are used first).
Reimplemented from GView.
GKGeoObject * G2DView::findClosestObject | ( | const GKPoint & | p, |
GKType * | type = NULL , |
||
double | maxDistance = 100 , |
||
double * | objDistance = NULL |
||
) |
Returns the closest object to a point. If a type is specified, only objects of that type will be considered. You can set a maximum distance (in meters) to scan and a variable to get the distance to the returned object
G2DViewLayer * G2DView::findLayer | ( | GKLayer * | modelLayer, |
bool | recursive = true |
||
) |
Find a layer using its GKLayer (its model).
int G2DView::getScreenHeight | ( | ) | const |
Returns the screen height in pixels (from QPaintDeviceMetrics::height )
int G2DView::getScreenWidth | ( | ) | const |
Returns the screen width in pixels (from QPaintDeviceMetrics::width )
const GKBBox & G2DView::getViewArea | ( | ) | const |
Current world area visible in the window (in m)
QWidget * G2DView::getWidget | ( | ) |
const GKBBox & G2DView::getWorld | ( | ) | const |
World coordinates, from and to (in m)
GKCoord G2DView::getZoom | ( | ) | const |
Current zoom factor (in m) 1:XX.
|
virtual |
Mark this view as invalid, forcing a redrawing.
Reimplemented from GView.
|
virtual |
Inverse the current selection, what is select will be unselected, what is unselected will be selected.
Reimplemented from GView.
bool G2DView::isMasterClock | ( | ) | const |
Are Clocks Synchronized?
bool G2DView::isMasterView | ( | ) | const |
Is a master view?
GKBBox G2DView::minBBox | ( | ) | const |
Minimum BBox for this view...
void G2DView::moveSelectionToViewCenter | ( | ) |
Translates the current selection making the center of the selection BBOX the same as the center of the current view area.
|
virtual |
Find all the objects in where the point dp its interior to it. The modifier can be used to look only on:
Also an additional parameter to extend the search to non_editable layers can be specified.
Reimplemented from GView.
void G2DView::pan | ( | const GKPoint & | ) |
Makes point the center of the visible area
|
virtual |
Makes the center of the bbox og object key the center of the visible area
Reimplemented from GView.
void G2DView::paste | ( | ) |
GKCoord G2DView::pixel2Unit | ( | int | , |
eDPIToUse | = eHorizontalDPI |
||
) | const |
Converts a size from device coordinates to world coordinates.
void G2DView::preferencesChanged | ( | ) |
Read preferences after a change
|
virtual |
Save a snapshot of this view in a file. The size of the image is either width and height or the current size of the view (if width or height are equal to -1).
Reimplemented from GView.
|
virtual |
Converts a point from device coordinates to world coordinates.
Implements GView.
|
virtual |
Select all the objects in the geo model. Note that this selection if per geo model and not per view (objects selected in this view are selected in the rest of the views too).
Reimplemented from GView.
void G2DView::setAttributeForDynamicLabel | ( | GKGeoObject * | object, |
GKColumn * | newAttribute | ||
) |
|
virtual |
Restrict the draw of objects to the ones that are inside a subnetwork (if NULL everything will be draw).
Reimplemented from GView.
void G2DView::setMasterClock | ( | bool | value | ) |
void G2DView::setMasterView | ( | bool | ) |
void G2DView::setTimeContext | ( | const GKContext & | ) |
void G2DView::setWorld | ( | const GKBBox & | ) |
Set the maximum and minimum coordinates for this view. Done by G2DView::setGui when creating the drawers from the geo model. Its called also by the slot G2DView::worldResized when the world is resized because a new object has been add.
double G2DView::unit2Pixel | ( | GKCoord | , |
eDPIToUse | = eHorizontalDPI |
||
) | const |
Converts a size from world coordinates to device coordinates.
void G2DView::wholeArea | ( | const GKBBox & | ) |
Centers the area in the view and changes the zoom to ensure its complete vissibility.
void G2DView::wholeWorld | ( | ) |
Centers the world in the view and changes the zoom to ensure its complete vissibility.
void G2DView::zoom | ( | const GKBBox & | ) |
Changes the current drawing scale and pan so that the center of "area" is the center of the view and "area" is totally visible and, if possible, the current view shows only the "area".
void G2DView::zoom | ( | GKCoord | ) |
Changes the current drawing scale. The point in the center of the visible area will remain the center after the operation.
void G2DView::zoom | ( | GKCoord | , |
const GKPoint & | |||
) |
Changes the current drawing scale. The point panPoint will keep its XY coordinates in device space (that is, it will be in the same relative location)
|
static |
Defines the zoom factor limit from where the objects will be drawn as simple or complex. With a zoom factor greater that this value the object will be drawn as complex and with a value lower that this factor it will be drawn as simple