Class LayerMap (version 0.18)Description: An object representing an arbitrary mapping of physical layers to logical layers "Physical" layers are stream layers or other separated layers in a CAD file. "Logical" layers are the layers present in a Layout object. Logical layers are represented by an integer index while physical layers are given by a layer and datatype number or name. A logical layer is created automatically in the layout on reading if it does not exist yet. The mapping describes an association of a set of physical layers to a set of logical ones, where multiple physical layers can be mapped to a single logical one, which effectively merges the layers. This class has been introduced in version 0.18.
Method Overview
assign( LayerMap other )Description: Assign the contents of another object to self This method assigns the contents of another object to self. This is a deep copy that does not only copy the reference but the actual content.
clearDescription: Clears the map.
destroyDescription: Explicitly destroy the object Explicitly destroy the object on C++ side if it was owned by the Ruby interpreter. Subsequent access to this object will throw an exception. If the object is not owned by Ruby, this method will do nothing.
[const] bool destroyedDescription: Tell, if the object was destroyed This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.
[const] LayerMap dupDescription: Creates a copy of self.
[const] bool is_mapped?( LayerInfo layer )Description: Check, if a given physical layer is mapped.
[const] int logical( LayerInfo layer )Description: Returns the logical layer (the layer index in the layout object) for a given physical layer.
map( LayerInfo phys_layer, unsigned int log_layer )Description: Maps a physical layer to a logical one. In general, there may be more than one physical layer mapped to one logical layer. This method will add the given physical layer to the mapping for the logical layer.
map( LayerInfo pl_start, LayerInfo pl_stop, unsigned int log_layer )Description: Maps a physical layer interval to a logical one. This method maps an interval of layers l1..l2 and datatypes d1..d2 to the mapping for the given logical layer. l1 and d1 are given by the pl_start argument, while l2 and d2 are given by the pl_stop argument.
map( string map_expr, unsigned int log_layer )Description: Maps a physical layer given by a string to a logical one. The string expression is constructed using the syntax: "list[/list][;..]" for layer/datatype pairs. "list" is a sequence of numbers, separated by comma values or a range separated by a hyphen. Examples are: "1/2", "1-5/0", "1,2,5/0", "1/5;5/6".
[const] LayerInfo mapping( unsigned int log_layer )Description: Returns the mapped physical layer for a given logical layer. In general, there may be more than one physical layer mapped to one logical layer. This method will return a single one of them. It will return the one with the lowest layer and datatype.
[const] string mapping_str( unsigned int log_layer )Description: Returns the mapping string for a given logical layer. The mapping string is compatible with the string that the "map" method accepts.
|