18#include <nlohmann/json.hpp>
40REveStraightLineSet::REveStraightLineSet(
const std::string&
n,
const std::string& t):
43 fLinePlex (sizeof(
Line_t), 4),
92 l->fV1[0] =
x1;
l->fV1[1] =
y1;
l->fV1[2] = z1;
93 l->fV2[0] =
x2;
l->fV2[1] =
y2;
l->fV2[2] = z2;
132 l.fV1[1] + (
l.fV2[1] -
l.fV1[1])*pos,
133 l.fV1[2] + (
l.fV2[2] -
l.fV1[2])*pos,
145 TAttLine::operator=(*
m);
146 TAttMarker::operator=(*
m);
164 TAttLine ::SaveLineAttributes (out, var);
198 if (n_lines + n_markers == 0)
202 fRenderData = std::make_unique<RD>(
"makeStraightLineSet");
205 auto &pos =
fRenderData->NewEntry(
"pos", RD::EType::kF32, 3)
206 .Role(RD::ERole::kVertex)
207 .Prim(RD::EPrim::kLines)
208 .Reserve(2 * n_lines);
212 pos.Push((
const Float_t *)
l->fV1, 3);
213 pos.Push((
const Float_t *)
l->fV2, 3);
218 auto &mrk =
fRenderData->NewEntry(
"mrk", RD::EType::kF32, 4).Reserve(n_markers);
219 auto &mline =
fRenderData->NewEntry(
"mline", RD::EType::kI32, 1).Role(RD::ERole::kData).Reserve(n_markers);
223 mrk.Push(
m->fV[0],
m->fV[1],
m->fV[2], 0.f);
224 mline.Push(
m->fLineId);
227 mrk.AsTexture(RD::ETexFormat::kRGBA32F, 1);
237 return TClass::GetClass<REveStraightLineSetProjected>();
short Marker_t
Marker number (short)
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char y1
Char_t * Atom(Int_t idx) const
void Reset(Int_t atom_size, Int_t chunk_size)
Empty the container and reset it with given atom and chunk sizes.
void Refit()
Refit the container so that all current data fits into a single chunk.
virtual Int_t WriteCoreJson(nlohmann::json &cj, Int_t rnr_offset)
Write core json.
void BBoxCheckPoint(const REveVector &v)
virtual void WriteVizParams(std::ostream &out, const TString &var)
Write-out visual parameters for this object.
virtual void InitMainTrans(Bool_t can_edit=kTRUE)
Initialize the main transformation to identity matrix, without motion.
std::unique_ptr< REveRenderData > fRenderData
! Render data entries for the client's maker, see REveRenderData.
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.
void BBoxInit()
Start filling the bounding box with BBoxCheckPoint(): min at +infinity, max at -infinity,...
virtual void SetProjection(REveProjectionManager *mng, REveProjectable *model)
Sets projection manager and reference in the projectable object.
void SetDepthCommon(Float_t d, REveElement *el)
Set the depth and stamp el for a rebuild.
REveProjectable * fProjectable
REveProjectionManager * fManager
REveProjectionManager Manager class for steering of projections and managing projected objects.
REveProjection * GetProjection()
const REveTrans * GetModelTrans(REveElement *model, REveTrans &t)
Return the matrix that takes the coordinates of model into the frame of this manager,...
REveProjection Base for specific classes that implement non-linear projections.
void ProjectPointfv(Float_t *v, Float_t d)
Project float array.
virtual Bool_t HasSeveralSubSpaces() const
virtual Bool_t AcceptSegment(REveVector &, REveVector &, Float_t) const
virtual void BisectBreakPoint(REveVector &vL, REveVector &vR, Float_t eps_sqr)
Find break-point on both sides of the discontinuity.
Render data of an element: a client maker name and a list of tagged entries, each a typed array with ...
REveStraightLineSetProjected()
Constructor.
void UpdateProjection() override
Callback that actually performs the projection.
void SetDepthLocal(Float_t d) override
Set depth (z-coordinate) of the projected points.
void SetProjection(REveProjectionManager *mng, REveProjectable *model) override
Set projection manager and model object.
REveStraightLineSet Set of straight lines with optional markers along the lines.
Line_t * AddLine(Float_t x1, Float_t y1, Float_t z1, Float_t x2, Float_t y2, Float_t z2)
Add a line.
Marker_t * AddMarker(Float_t x, Float_t y, Float_t z, Int_t line_id=-1)
Add a marker with given position.
TClass * ProjectedClass(const REveProjection *p) const override
Return class of projected object.
Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override
Fill core part of JSON representation.
void BuildRenderData() override
Write the render data entries pos, mrk and mline, see the class description.
void ComputeBBox() override
Fill the bounding box (virtual from REveElement).
REveChunkManager fMarkerPlex
void SetLine(int idx, Float_t x1, Float_t y1, Float_t z1, Float_t x2, Float_t y2, Float_t z2)
Set line vertices with given index.
void CopyVizParams(const REveElement *el) override
Copy visualization parameters from element el.
REveChunkManager fLinePlex
REveChunkManager & GetLinePlex()
REveChunkManager & GetMarkerPlex()
void WriteVizParams(std::ostream &out, const TString &var) override
Write visualization parameters.
void MultiplyIP(TVector3 &v, Double_t w=1) const
Multiply vector in-place.
Width_t fLineWidth
Line width.
Style_t fLineStyle
Line style.
Color_t fLineColor
Line color.
virtual void SaveMarkerAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t sizdef=1)
Save line attributes as C++ statement(s) on output stream out.
Color_t fMarkerColor
Marker color.
Size_t fMarkerSize
Marker size.
Style_t fMarkerStyle
Marker style.
TClass instances represent classes, structs and namespaces in the ROOT type system.
Namespace for ROOT features in testing.
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Bool_t next()
Go to next atom.