Itasca C++ Interface
Loading...
Searching...
No Matches
ipiece.h
1#pragma once
2// ipiece.h
3
4// Interface for Piece
5
6#include "dim.h"
7#include "base/src/farray.h"
8#include "base/src/property.h"
9
10namespace itascaxd {
11 using namespace itasca;
12 class IContact;
13 class IBody;
14
16 class IPiece {
17 public:
19 inline static const TType type_ = 0x4c815b8f;
20 // Returns an IThing interface
21 virtual IThing * getIThing()=0;
22 virtual const IThing *getIThing() const=0;
23
24 // Returns a list of contacts connected to this piece.
25 // If type is specified, restricts to contacts matching that type.
26 // If p2 is specified, restricts to contacts with that piece.
27 // NOTE: We will be able to do "MOVE COPY" semantics here in VS2010.
28 virtual void getContactList(FArray<IContact *> *ret,const TType &type=0,const IPiece *p2=0)=0;
29 virtual void getContactList(FArray<const IContact *> *ret,const TType &type=0,const IPiece *p2=0) const=0;
30
31 // Return the count of contacts, active and inactive
32 virtual uint64 getContactCount(bool active,const TType &type=0,bool domainToo = false) const = 0;
33
34 // Returns TRUE if a matching contact exists to this piece.
35 // If type is specified, contact must match that type.
36 // If p2 is specified, contact must be with that piece.
37 virtual bool hasContact(const TType &type=0,const IPiece *p2=0) const=0;
38
39 // Get a pointer to the body to which this Piece belongs
40 virtual IBody * getIBody()=0;
41 virtual const IBody *getIBody() const=0;
42
43 // Get a pointer to the IThing used for interactions
44 virtual IThing * getIThingForInteraction()=0;
45 virtual const IThing * getIThingForInteraction() const=0;
46
47 // Get next IPiece in the LOCAL list of Pieces associated with this Body
48 virtual IPiece * getNextPiece()=0;
49 virtual const IPiece *getNextPiece() const=0;
50
51 // Piece properties
52 virtual bool setProperty(const string &name,const base::Property &v)=0;
53 virtual base::Property getProperty(const string &name) const=0;
54 virtual StringList getAllProperties() const=0;
55 virtual bool isProperty(const string &name) const=0;
56
57 // Piece attributes
58 virtual bool setAttribute(const string &name,const base::Property &v)=0;
59 virtual base::Property getAttribute(const string &name) const=0;
60 virtual StringList getAllAttributes() const=0;
61 virtual bool isAttribute(const string &name) const=0;
62
63 // Get the ultimate derived type
64 virtual TType getDerivedType() const=0;
65
66
67 };
68
69} // namespace itascaxd
70// EoF
An array class that attempts to minimize unnecessary heap access.
Definition farray.h:25
Definition basestring.h:71
Definition property.h:36
Base class for items that will be stored in containers.
Definition ithing.h:31
Definition ibody.h:22
Definition ipiece.h:16
static const TType type_
The type identification number for this class, for use in convert_cast() and convert_getcast().
Definition ipiece.h:19
DIM - Provides code portability between 2D and 3D codes.
An array class that attempts to minimize unnecessary heap access.
uint32 TType
class type indicator
Definition basedef.h:47
namespace Itasca
Definition basememory.cpp:14
Itasca Library standard namespace, specific to 2D or 3D.
Definition icontactmodule.h:6