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

The Push class Allows for pushing all entities on the stack for the next operation. More...

#include <entityops.h>

Inheritance diagram for lc::operation::Push:
Collaboration diagram for lc::operation::Push:

Public Member Functions

 Push ()
 
virtual ~Push ()
 
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 ()
 

Detailed Description

The Push class Allows for pushing all entities on the stack for the next operation.

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))
b:rotate(Coord(0,0), math.rad(45))
b:loop(7)
b:push(); – push all entities on the stack for the next operation
b:copy(Coord(100,0)); – copy all entities relative to position 100,0
b:execute()

Definition at line 256 of file entityops.h.

Constructor & Destructor Documentation

Push::Push ( )

Push

Definition at line 188 of file entityops.cpp.

188  : Base() {
189 }
Push::~Push ( )
virtual

Definition at line 203 of file entityops.cpp.

203  {
204 
205 }

Member Function Documentation

std::vector< entity::CADEntity_CSPtr > Push::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 191 of file entityops.cpp.

196  {
197  std::vector<entity::CADEntity_CSPtr> newQueue(workingBuffer);
198  newQueue.insert(newQueue.end(), entitySet.begin(), entitySet.end());
199  workingBuffer.clear();
200  return newQueue;
201 }

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