14 #ifndef __LAYERINF_H__
15 #define __LAYERINF_H__
21 #include "wx/geometry.h"
33 const double LAYERINFO_WIDTH = 100;
34 const double LAYERINFO_HEIGHT = 100;
69 virtual wxString
GetName()
const;
76 virtual void SetName(
const wxString& name );
105 bool GetPixelStroke();
124 void SetOrder( wxUint16 order );
126 void SetRead(
bool status );
128 void SetInMapping( wxUint16 layer );
130 void SetOutMapping( wxUint16 layer );
133 void SetPixelStroke(
bool pixel );
139 void SetFeature(
const wxString& feature ) { m_feature = feature; }
145 void SetSubFeature(
const wxString& subfeature ) { m_subFeature = subfeature; }
148 const wxString&
GetType()
const {
return m_type; }
151 void SetType(
const wxString& type ) { m_type = type; }
154 const wxString&
GetSide()
const {
return m_side; }
157 void SetSide(
const wxString& side ) { m_side = side; }
163 const wxString&
GetSpan()
const {
return m_span; }
166 void SetSpan(
const wxString& span ) { m_span = span; }
171 void SetDescription(
const wxString& description ) { m_description = description; }
177 void SetArea(
double area ) { m_area = area; }
197 void SetObjectCount( wxUint32 numberOfObjects ) { m_canvasObjectCount = numberOfObjects; }
216 m_canvasPreviousObjectCount != 0 && m_canvasObjectCount == 0 ||
217 m_canvasPreviousObjectCount == 0 && m_canvasObjectCount != 0
227 #if wxART2D_USE_CVGIO
231 #endif //wxART2D_USE_CVGIO
313 mutable wxUint32 m_canvasPreviousObjectCount;
317 DECLARE_EVENT_TABLE()
322 static const a2dSignal sig_changedLayerInfo;
340 #if defined(WXART2D_USINGDLL)
341 template class A2DCANVASDLLEXP std::allocator< a2dSmrtPtr<a2dLayerInfo> >;
342 template class A2DCANVASDLLEXP std::vector< a2dSmrtPtr<a2dLayerInfo> >;
348 typedef std::vector<a2dLayerInfoPtr> a2dLayerIndex;
392 void SetFileName(
const wxFileName& filename ) { m_filename = filename; }
419 void InitWith(
int highlayer,
bool blackWhite );
421 wxString
GetName(
int layernumber );
422 int GetNumber( wxString name );
426 a2dFill GetFill(
int layernumber );
427 int GetOrder(
int layernumber );
428 bool GetRead(
int layernumber );
429 int GetInMapping(
int layernumber );
430 int GetOutMapping(
int layernumber );
432 bool GetPixelStroke(
int layernumber );
434 void SetName(
int layernumber, wxString name );
436 void SetVisible(
int layernumber,
bool =
true );
437 void SetAvailable(
int layernumber,
bool =
true );
440 void SetOrder(
int layernumber,
int status );
441 void SetRead(
int layernumber,
bool =
true );
442 void SetInMapping(
int layernumber, wxUint16 layer );
443 void SetOutMapping(
int layernumber, wxUint16 layer );
446 void SetPattern(
int layernumber,
const wxBitmap& stipple );
448 void SetPixelStroke(
int layernumber,
bool =
true );
462 void SetAllLayersAvailable(
bool onoff );
483 #if wxART2D_USE_CVGIO
487 #endif //wxART2D_USE_CVGIO
491 a2dLayerIndex m_layerArrayOnOrder;
492 a2dLayerIndex m_layerArrayOnReverseOrder;
493 a2dLayerIndex m_layerArrayOnLayer;
503 static const a2dSignal sig_visibleAll;
504 static const a2dSignal sig_selectAll;
505 static const a2dSignal sig_outlineAll;
506 static const a2dSignal sig_readAll;
507 static const a2dSignal sig_availableAll;
513 wxFileName m_filename;
527 #if defined(WXART2D_USINGDLL)
void SetSpan(const wxString &span)
see GetSpan()
Base class for all types of strokes, understood by a2dDrawer2D classes.
virtual bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
wxString m_layername
name of the layer
void SetPreviousObjectCount(wxUint32 numberOfObjects)
set currently counted number of objects on this layer inside a document.
index on layer reverse order
void SetFileName(const wxFileName &filename)
set filename based on file where layers were read from
a2dLayerInfo * operator[](int indx)
element operator
void SetAll_Layers_Selectable(bool onoff)
set all visible layers selectable
virtual wxString GetName() const
Returns the name of this object, if no name is given the internal id will be returned.
const wxString & GetFeature() const
this layer is part of a group of layers to present a feature ( metalized via etc. )...
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
Clone this object and return a pointer to the new object.
class to map references to objects stored in XML, in order to make the connection later on...
bool GetAvailable()
are there objects on this layer
wxUint32 GetPreviousObjectCount()
get currently counted number of objects on this layer inside a document.
bool m_readlayer
will the layer be read from a file
void SetAll_Layers_Outline(bool onoff)
set all visible layers outline
wxUint16 m_outmap
mapping to this layer from the file layer in the output file
This is a class/type description for a2dPin's.
void SetPlated(bool plated)
void SetFeature(const wxString &feature)
this layer is part of a group of layers to present a feature ( metalized via etc. )...
double m_height
height of rectangle
a2dPinClass * m_pinclass
The class defines to which other pins a pin on this layer can connect.
Input and output handler for the XmlSer format.
UpdateMode
Various mode flags for Update.
void SetPolarity(bool polarity)
set if the mask is negative or positive
void SetSelectable(bool selectable)
Allows to select this object.
virtual void SetPending(bool pending)
set this object pending for update
OVERLAP
Result of a a2dBoundingBox intersection or hittest.
bool m_polarity
negative or positive
wxString m_subFeature
extra as part of a feature.
const wxString & GetSubFeature() const
extra as part of a feature.
The base class for all drawable objects in a a2dCanvasDocument.
void SetArea(double area)
used to save area occupied by all primitives on the layer
#define DECLARE_PROPERTIES()
check if class has the given id as a valid id for this object
virtual void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
const wxString & GetSpan() const
two layer names seperated by :
a2dCanvasObject is the base class for Canvas Objects.
std::vector< a2dLayerInfoPtr > & GetLayerIndex()
return array index on Layer
void SetSide(const wxString &side)
which side of board
wxString m_span
Used to tell for layers of type hole, in between which other two layers this hole starts and ends...
bool SaveLayers(const wxString &filename)
save layer object to CVG file
virtual void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
virtual void SetName(const wxString &name)
Creates the a2dStringProperty PROPID_Name.
const wxString & GetSide() const
which side of board
bool m_layervisible
is the layer visible
void OnPropertyChanged(a2dComEvent &event)
void SetPattern(int layernumber, const wxBitmap &stipple)
sets a a2dPatternFill to this stipple, if not a a2dPatternFill, it will be changed.
bool m_layerselectable
is the layer selectable
double m_area
used to save area occupied by all primitives on the layer
wxUint32 m_canvasObjectCount
bool StateChange()
layer became empty or filled?
void IncrementObjectCount()
increment currently counted number of objects on this layer inside a document.
bool GetPolarity()
get if the mask is negative or positive
const wxString & GetType() const
type of layer (mask, holes etc.)
wxString m_feature
this layer is part of a group of layers to present a feature ( metalized via etc. )...
bounding class for optimizing drawing speed.
wxUint32 GetObjectCount()
get currently counted number of objects on this layer inside a document.
wxString & GetDescription()
what is this layer for.
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
wxString m_side
which side of board
wxFileName & GetFileName()
get filename of layers files from which this object was read.
contains the layer properties for one layer,
Input and output handler for the XmlSer format.
return full boundingbox of derived object
void UpdateIndexes()
all non defined layers until wxMAXLAYER will be added a new childs.
void SetAll_Layers_Read(bool onoff)
set all layers read
a2dPinClass * GetPinClass() const
return the default pin class of this layer
wxString m_description
what is this layer for.
void SetAll_Layers_Visible(bool onoff)
set all layers visible
bool m_indexed
to test if index array are valid
void SetVisible(bool visible)
set if this object will visible (be rendered or not)
bool LoadLayers(const wxString &filename)
save layers to a file
A list class for reference counted objects.
double GetArea()
used to save area occupied by all primitives on the layer
while iterating a a2dCanvasDocument, this holds the context.
void DecrementObjectCount()
decrement currently counted number of objects on this layer inside a document.
void SetStroke(const wxColour &strokecolor, double width=0, a2dStrokeStyle style=a2dSTROKE_SOLID)
Set a stroke for the object which will be used instead of the layer stroke.
std::vector< a2dLayerInfoPtr > & GetReverseOrderIndex()
return array index on ReverseOrder
void SetPinClass(a2dPinClass *pinClass)
Set the default pin class for this layer.
void SetSubFeature(const wxString &subfeature)
extra as part of a feature.
wxUint16 m_order
drawing order number
void SetObjectCount(wxUint32 numberOfObjects)
set currently counted number of objects on this layer inside a document.
double m_width
width of rectangle
bool GetVisible() const
get visibility (rendering depends on layer settings also)
bool GetSelectable() const
is the object selectable flag set
The a2dBoundingBox class stores one a2dBoundingBox of a a2dCanvasObject.
std::vector< a2dLayerInfoPtr > & GetOrderIndex()
return array index on Order
virtual a2dBoundingBox DoGetUnTransformedBbox(a2dBboxFlags flags=a2dCANOBJ_BBOX_NON) const
In derived object this should be overriden to calculate the boundingbox of the object without its chi...
virtual bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
This template class is for property ids with a known data type.
wxUint16 m_inmap
mapping to this layer from the file layer in the input file
void SetAvailable(bool status)
set layer available (will be rendered)
void SetType(const wxString &type)
type of layer (mask, holes etc.)
A pointer class, that automatically calls SmrtPtrOwn/SmrtPtrRelease.
CloneOptions
options for cloning
wxString m_type
type of layer (mask, holes etc.)
basic 2 point line class for intersection and contouring routines.
structure to give as parameter to member functions of a2dCanvasObject
Contain one drawing as hierarchical tree of a2dCanvasObject's.
void SetFill(const a2dFill &fill)
Set a fill for the object which will be used instead of the layer fill.
general canvas module declarations and classes