10 std::string indent(indentwidth,
' ');
11 std::string indent2(indentwidth + 8,
' ');
14 std::cout << indent <<
"rectangle, \n"
15 << indent2 <<
"w: " <<
width_m <<
", \n"
16 << indent2 <<
"h: " <<
height_m <<
", \n"
17 << indent2 <<
"origin: " << origin[0] <<
", " << origin[1] <<
",\n"
18 << indent2 <<
"angle: " << angle <<
"\n"
28 std::vector<Vector_t<double, 3>> corners(
39 for (
unsigned int i = 1; i < 4; ++i) {
40 if (corners[i][0] < llc[0])
41 llc[0] = corners[i][0];
42 else if (corners[i][0] > urc[0])
43 urc[0] = corners[i][0];
45 if (corners[i][1] < llc[1])
46 llc[1] = corners[i][1];
47 else if (corners[i][1] > urc[1])
48 urc[1] = corners[i][1];
54 item->computeBoundingBox();
64 if (item->isInside(R))
return false;
73 std::vector<Vector_t<double, 3>> pts(
78 unsigned int width = out.precision() + 8;
79 for (
unsigned int i = 0; i < 5; ++i) {
83 out << std::setw(width) << pt[0] << std::setw(width) << pt[1] << std::endl;
88 item->writeGnuplot(out);
95 bfuncs.emplace_back(this->
clone());
99 std::shared_ptr<Rectangle> rect(
new Rectangle);
106 rect->divisor_m.emplace_back(item->clone());
109 return std::static_pointer_cast<Base>(rect);
113 std::string str(it, end);
122 }
catch (std::runtime_error& e) {
123 std::cout << e.what() << std::endl;
128 std::cout <<
"Rectangle: a negative width provided '" << arguments.
get(0) <<
" = "
129 << rect->
width_m <<
"'" << std::endl;
133 std::cout <<
"Rectangle: a negative height provided '" << arguments.
get(1) <<
" = "
134 << rect->
height_m <<
"'" << std::endl;
ippl::Vector< T, Dim > Vector_t
double parseMathExpression(const std::string &str)
std::string::iterator iterator
std::vector< std::shared_ptr< Base > > divisor_m
AffineTransformation trafo_m
bool isInside(const Vector_t< double, 3 > &X) const
static const std::string UDouble
virtual void computeBoundingBox()
virtual void apply(std::vector< std::shared_ptr< Base > > &bfuncs)
static bool parse_detail(iterator &it, const iterator &end, Function *fun)
virtual void writeGnuplot(std::ofstream &out) const
virtual std::shared_ptr< Base > clone() const
virtual bool isInside(const Vector_t< double, 3 > &R) const
virtual void print(int indentwidth)