113 out << t <<
"SetFillColor(" <<
fFillColor <<
");\n";
114 out << t <<
"SetLineColor(" <<
fLineColor <<
");\n";
115 out << t <<
"SetLineWidth(" <<
fLineWidth <<
");\n";
134 for (
Int_t i = 1; i <
N; ++i)
136 if (pin[i].fY < pin[min_point].fY || (pin[i].fY == pin[min_point].fY && pin[i].fX < pin[min_point].fX))
141 std::vector<Float_t> angles(
N);
142 for (
Int_t i = 0; i <
N; ++i)
144 angles[i] = (pin[i] - pin[min_point]).Phi();
146 std::vector<Int_t> idcs(
N);
153 std::vector<Int_t> new_idcs;
154 new_idcs.push_back(idcs[0]);
155 auto a = idcs.begin(); ++
a;
157 while (
b != idcs.end())
161 if (pin[idcs[0]].SquareDistance(pin[*
a]) < pin[idcs[0]].SquareDistance(pin[*
b]))
166 new_idcs.push_back(*
a);
171 new_idcs.push_back(*
a);
178 std::vector<Int_t> hull;
181 hull.push_back(idcs[0]);
182 hull.push_back(idcs[1]);
183 hull.push_back(idcs[2]);
188 Int_t n = hull.size() - 1;
189 if ((pin[hull[
n]] - pin[hull[
n-1]]).
Cross(pin[idcs[i]] - pin[hull[
n]]) > 0)
191 hull.push_back(idcs[i]);
203 ::Warning(
"REveShape::FindConvexHull()",
"Polygon reduced to %d points. for '%s'.",
204 N, caller ? caller->
GetCName() :
"unknown");
210 Int_t Nold = pout.size();
211 pout.resize(Nold +
N);
212 for (
Int_t i = 0; i <
N; ++i)
214 pout[Nold + i] = pin[hull[i]];
238 return up.
Dot(
f1.Cross(f2)) < 0;
253 return up.
Dot(
f1.Cross(f2)) < 0;
void Warning(const char *location, const char *msgfmt,...)
TGLVector3 Cross(const TGLVector3 &v1, const TGLVector3 &v2)
void SetMainColorPtr(Color_t *colptr)
Bool_t fCanEditMainTransparency
virtual Int_t WriteCoreJson(nlohmann::json &cj, Int_t rnr_offset)
Write core json.
const char * GetCName() const
virtual void WriteVizParams(std::ostream &out, const TString &var)
Write-out visual parameters for this object.
static const std::string & ToString(Bool_t b)
Convert Bool_t to string - kTRUE or kFALSE.
virtual void CopyVizParams(const REveElement *el)
Copy visualization parameters from element el.
virtual void SetMainColor(Color_t color)
Set main color of the element.
void WriteVizParams(std::ostream &out, const TString &var) override
Write visualization parameters.
static Int_t FindConvexHull(const vVector2_t &pin, vVector2_t &pout, REveElement *caller=nullptr)
Determines the convex-hull of points in pin.
void CopyVizParams(const REveElement *el) override
Copy visualization parameters from element el.
std::vector< REveVector2 > vVector2_t
static void CheckAndFixBoxOrientationFv(Float_t box[8][3])
Make sure box orientation is consistent with standard arrangement.
virtual ~REveShape()
Destructor.
static Bool_t IsBoxOrientationConsistentEv(const REveVector box[8])
Checks if the first face normal is pointing into the other direction as the vector pointing towards t...
static Bool_t IsBoxOrientationConsistentFv(const Float_t box[8][3])
Checks if the first face normal is pointing into the other direction as the vector pointing towards t...
Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override
Fill core part of JSON representation.
static void CheckAndFixBoxOrientationEv(REveVector box[8])
Make sure box orientation is consistent with standard arrangement.
REveShape(const REveShape &)
void SetMainColor(Color_t color) override
Set main color.
TT Dot(const REveVectorT &a) const
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
void swap(RDirectoryEntry &e1, RDirectoryEntry &e2) noexcept
void Sort(Index n, const Element *a, Index *index, Bool_t down=kTRUE)