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

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

#include <entityops.h>

Inheritance diagram for lc::operation::Rotate:
Collaboration diagram for lc::operation::Rotate:

Public Member Functions

 Rotate (const geo::Coordinate &rotation_center, const double rotation_angle)
 
virtual ~Rotate ()
 
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 _rotation_center
 
double _rotation_angle
 

Detailed Description

The Rotate 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))
b:rotate(Coord(0,0), math.rad(45)); – rotate the set of entities around point 0,0 with 45 degrees
b:loop(7)
b:execute()

Definition at line 197 of file entityops.h.

Constructor & Destructor Documentation

Rotate::Rotate ( const geo::Coordinate rotation_center,
const double  rotation_angle 
)

Rotate

Definition at line 162 of file entityops.cpp.

162  : Base(), _rotation_center(rotation_center), _rotation_angle(rotation_angle) {
163 }
geo::Coordinate _rotation_center
Definition: entityops.h:212
Rotate::~Rotate ( )
virtual

Definition at line 181 of file entityops.cpp.

181  {
182 
183 }

Member Function Documentation

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

170  {
171  std::vector<entity::CADEntity_CSPtr> newQueue;
172 
173  for (auto entity : entitySet) {
174  auto e = entity->rotate(_rotation_center, _rotation_angle);
175  newQueue.push_back(e);
176  }
177 
178  return newQueue;
179 }
geo::Coordinate _rotation_center
Definition: entityops.h:212

Member Data Documentation

double lc::operation::Rotate::_rotation_angle
private

Definition at line 213 of file entityops.h.

geo::Coordinate lc::operation::Rotate::_rotation_center
private

Definition at line 212 of file entityops.h.


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