LibreCAD
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
lc::operation::Copy Class Reference

The Copy class Allows for copy of the current set of entities. More...

#include <entityops.h>

Inheritance diagram for lc::operation::Copy:
Collaboration diagram for lc::operation::Copy:

Public Member Functions

 Copy (const geo::Coordinate &offset)
 
virtual ~Copy ()
 
virtual std::vector
< entity::CADEntity_CSPtr > 
process (const std::shared_ptr< Document > document, std::vector< entity::CADEntity_CSPtr > entities, std::vector< entity::CADEntity_CSPtr > &workingBuffer, std::vector< entity::CADEntity_CSPtr > &removals, const std::vector< Base_SPtr > operationStack)
 
- Public Member Functions inherited from lc::operation::Base
virtual ~Base ()
 

Private Attributes

geo::Coordinate _offset
 

Detailed Description

The Copy class Allows for copy of the current set of entities.

Example (lua):

l=Line(Coord(0,0), Coord(10,100));
d=app.currentDocument()
b=Builder(d)
b:append(l)
b:begin()
b:copy(Coord(0,0));Copy the entities 'in place'
b:rotate(Coord(0,0), math.rad(45))
b:loop(7)
b:execute()

Definition at line 160 of file entityops.h.

Constructor & Destructor Documentation

Copy::Copy ( const geo::Coordinate offset)

Copy

Definition at line 109 of file entityops.cpp.

109  : Base(), _offset(offset) {
110 }
geo::Coordinate _offset
Definition: entityops.h:175
Copy::~Copy ( )
virtual

Definition at line 129 of file entityops.cpp.

129  {
130 
131 }

Member Function Documentation

std::vector< entity::CADEntity_CSPtr > Copy::process ( const std::shared_ptr< Document document,
std::vector< entity::CADEntity_CSPtr >  entities,
std::vector< entity::CADEntity_CSPtr > &  workingBuffer,
std::vector< entity::CADEntity_CSPtr > &  removals,
const std::vector< Base_SPtr >  operationStack 
)
virtual

Implements lc::operation::Base.

Definition at line 112 of file entityops.cpp.

117  {
118  std::vector<entity::CADEntity_CSPtr> newQueue;
119 
120  for (auto entity : entitySet) {
121  auto e = entity->copy(_offset);
122  workingBuffer.push_back(entity);
123  newQueue.push_back(e);
124  }
125 
126  return newQueue;
127 }
geo::Coordinate _offset
Definition: entityops.h:175

Member Data Documentation

geo::Coordinate lc::operation::Copy::_offset
private

Definition at line 175 of file entityops.h.


The documentation for this class was generated from the following files: