ShapeView

## class ShapeView : public Thing

> Class containing a single view (set of shapes).

## Inheritance:

### Public Methods

  | ShapeView (DiagramViewer *v)
  virtual | ~ShapeView ()
  int | GetClassType () const
  bool | IsView () const
  void | Draw () draw all shapes in the view.
  void | Undraw () erase all shapes in the view.
  void | SetGrafport (Grafport *g) set grafport of all shapes.
  Node* | GetParent () const each view has a parent node.
  void | SetParent (Node *n)
  const string* | GetIndex () const each view has a unique index.
  void | SetIndex (string *s)
  unsigned | NrOfShapes () const the number of shapes.
  List <GShape *> * | GetShapes () const
  List <GShape *> * | GetSelection () const
  bool | HasShape (GShape *s)
  void | Snap (Point *p) Snap point to discrete point-position.
  int | Snap (int i) Snap int to discrete point-position.
  DiagramViewer* | GetViewer () const
  void | WriteShapes (OutputFile *f) write all shapes to file (in separate clauses).
  bool | ReadMembers (InputFile *f, double format) read view section.
  bool | SetReferences (AssocList *) update references when view is read.
  bool | CheckReferences () Check parent node, Check that shapes have right view reference.
  void | CheckShapes () find all shapes with wrong references;
  unsigned | NrSelected () const the number of selected shapes.
  GShape* | FirstSelected () const return the first selected shape.
  void | DeselectAll () deselect all shapes in the view.
  virtual void | SelectShape (GShape *shape) add shape to selection.
  virtual void | FirstSelectShape (GShape *shape) add shape to selection as primus inter pares.
  void | DeselectShape (GShape *shape) remove shape to selection.
  GShape* | HitShape (int x, int y) return shape from view if (x,y) is in shape.
  NodeShape* | HitNodeShape (int x, int y) return node from view if (x,y) is in shape.
  Line* | HitLine (int x, int y, int &whichsegment) return line from view if (x,y) is in line. segment is set to which segment.
  Line* | HitLineHandle (int x, int y, int &which) return line from view if (x,y) hits handle.
  TextShape* | HitTextShape (int x, int y, bool emptyallowed=True) return text-shape from view if (x,y) is in shape.
  int | GetCurrentShapeNr () const
  void | SetCurrentShapeNr (int i)
  void | SetCurrentShapeNr (GShape *s)
  GShape* | GetNextShape (const string *s, bool sens, bool substring, bool nameOnly) return the next shape containing s as name.
  void | GetShapes (List<GShape *> *shapes, const string *s, bool sens, bool substring, bool nameOnly) get shapes containing s as name (case sensitive, substring).
  void | CalcSizeElements (Point &topLeft, Point &bottomRight)
  void | CalcSizeSelection (Point &topLeft, Point &bottomRight)
  void | CalcSizeShapes (List<GShape *> *shapes, Point &topLeft, Point &bottomRight) calculate covered area of shapes in grafport.
  void | AddShapeRaw (GShape *shape) add to viewer and draw/redraw shape.
  virtual void | AddShape (GShape *shape) add to viewer and draw/redraw shape and recalc. line positions.
  void | AddShapes (List<GShape *> *shapes)
  void | RemoveShapeRaw (GShape *shape) remove from viewer and erase shape.
  virtual void | RemoveShape (GShape *shape) remove from viewer, and erase drawing and recalc line positions.
  void | RemoveShapes (List<GShape *> *shapes)
  GShape* | GetShape (Subject *subject) return first shape from shapes having given subject.
  void | GetShapes (Subject *subject, List<GShape *> *shapes) put in shapes all shapes from shapes having given subject.
  void | MultipleLinesPosUpdate (Line *line) update the positions of the lines connecting same shapes as line.
  void | MultipleLines (Line *line) update multiple lines between two nodes (called when line added).
  void | CompleteShapes (List<GShape *> *s, GShape *n1, GShape *n2) add to s all lines that connect shapes n1 and n2.
  void | CompleteLines (List<GShape *> *shapes) add shapes which are connected by the lines in shapes.
  void | CompleteShapes (List<GShape *> *shapes) add lines to shapes which connect the shapes in shapes.
  void | DrawNames () draw only names in view.
  void | ShowAll () make all shapes in view visible.

### Inherited from Thing:

### Public Classes

enum AssocType

### Public Methods

unsigned long GetId()
void SetId(unsigned long val)
virtual bool IsSubject() const
virtual bool IsShape() const
void Write(OutputFile *ofile)

## Documentation

> Class containing a single view (set of shapes).

`ShapeView(DiagramViewer *v)`

`virtual ~ShapeView()`

`int GetClassType() const`

`bool IsView() const`

`void Draw()`
  draw all shapes in the view.

`void Undraw()`
  erase all shapes in the view.

`void SetGrafport(Grafport *g)`
  set grafport of all shapes.

`Node* GetParent() const`
  each view has a parent node.

`void SetParent(Node *n)`

`const string* GetIndex() const`
  each view has a unique index.

`void SetIndex(string *s)`

`unsigned NrOfShapes() const`
  the number of shapes.

`List <GShape *> * GetShapes() const`

`List <GShape *> * GetSelection() const`

`bool HasShape(GShape *s)`

`void Snap(Point *p)`
  Snap point to discrete point-position.

`int Snap(int i)`
  Snap int to discrete point-position.

`DiagramViewer* GetViewer() const`

`void WriteShapes(OutputFile *f)`
  write all shapes to file (in separate clauses).

`bool ReadMembers(InputFile *f, double format)`
  read view section.

`bool SetReferences(AssocList *)`
  update references when view is read.

`bool CheckReferences()`
  Check parent node, Check that shapes have right view reference.

`void CheckShapes()`
  find all shapes with wrong references;

`unsigned NrSelected() const`
  the number of selected shapes.

`GShape* FirstSelected() const`
  return the first selected shape.

`void DeselectAll()`
  deselect all shapes in the view.

`virtual void SelectShape(GShape *shape)`
  add shape to selection.

`virtual void FirstSelectShape(GShape *shape)`
  add shape to selection as primus inter pares.

`void DeselectShape(GShape *shape)`
  remove shape to selection.

`GShape* HitShape(int x, int y)`
  return shape from view if (x,y) is in shape.

`NodeShape* HitNodeShape(int x, int y)`
  return node from view if (x,y) is in shape.

`Line* HitLine(int x, int y, int &whichsegment)`
  return line from view if (x,y) is in line. segment is set to which segment.

`Line* HitLineHandle(int x, int y, int &which)`
  return line from view if (x,y) hits handle.

`TextShape* HitTextShape(int x, int y, bool emptyallowed=True)`
  return text-shape from view if (x,y) is in shape.

`int GetCurrentShapeNr() const`

`void SetCurrentShapeNr(int i)`

`void SetCurrentShapeNr(GShape *s)`

`GShape* GetNextShape(const string *s, bool sens, bool substring, bool nameOnly)`
  return the next shape containing s as name.

`void GetShapes(List<GShape *> *shapes, const string *s, bool sens, bool substring, bool nameOnly)`
  get shapes containing s as name (case sensitive, substring).

`void CalcSizeElements(Point &topLeft, Point &bottomRight)`

`void CalcSizeSelection(Point &topLeft, Point &bottomRight)`

`void CalcSizeShapes(List<GShape *> *shapes, Point &topLeft, Point &bottomRight)`
  calculate covered area of shapes in grafport.

`void AddShapeRaw(GShape *shape)`
  add to viewer and draw/redraw shape.

`virtual void AddShape(GShape *shape)`
  add to viewer and draw/redraw shape and recalc. line positions.

`void AddShapes(List<GShape *> *shapes)`

`void RemoveShapeRaw(GShape *shape)`
  remove from viewer and erase shape.

`virtual void RemoveShape(GShape *shape)`
  remove from viewer, and erase drawing and recalc line positions.

`void RemoveShapes(List<GShape *> *shapes)`

`GShape* GetShape(Subject *subject)`
  return first shape from shapes having given subject.

`void GetShapes(Subject *subject, List<GShape *> *shapes)`
  put in shapes all shapes from shapes having given subject.

`void MultipleLinesPosUpdate(Line *line)`
  update the positions of the lines connecting same shapes as line.

`void MultipleLines(Line *line)`
  update multiple lines between two nodes (called when line added).

`void CompleteShapes(List<GShape *> *s, GShape *n1, GShape *n2)`
  add to s all lines that connect shapes n1 and n2.

`void CompleteLines(List<GShape *> *shapes)`
  add shapes which are connected by the lines in shapes.

`void CompleteShapes(List<GShape *> *shapes)`
  add lines to shapes which connect the shapes in shapes.

`void DrawNames()`
  draw only names in view.

`void ShowAll()`
  make all shapes in view visible.

Direct child classes:
  TRView
  ERView

alphabetic index hierarchy of classes

this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de