33#include <NDEVR/StationModel.h>
35#include <NDEVR/Deployment.h>
36#include <NDEVR/Material.h>
37#include <NDEVR/Geometry.h>
49 DrillHole(
const Model& model,
const Vector<3, fltp08>& location)
59 setLocation(location);
61 DrillHole(
const Model& model)
64 if (!hasMetaData(
"drill_hole"))
66 setMetaData(
"drill_hole",
true);
72 Model drillRow()
const
74 Model model = getParent();
75 while (model.isValid())
77 if (model.isOfType(
"drill_pattern_row"))
79 model = model.getParent();
83 Model drillPattern()
const
85 Model model = getParent();
86 while (model.isValid())
88 if (model.isOfType(
"drill_pattern"))
90 model = model.getParent();
94 void addHolePath(
const String& deployment_name,
const Buffer<Vertex<3, fltp08>>& locations,
const Buffer<Time>& times, fltp08 radius)
97 lib_assert(getChildrenByName(deployment_name).size() == 0,
"Unexpected duplicate path name");
98 Model hole_data = createChild();
99 Deployment deployment(hole_data);
100 deployment.addSegments(locations, times);
101 deployment.setProperty(DesignObject::e_name, deployment_name);
103 deployment.setUseTube(Geometry::ThicknessMode::e_circle, radius);
105 deployment.setUseTube(Geometry::ThicknessMode::e_pixel, 1.0);
108 void addHolePath(
const String& deployment_name,
const Buffer<Vertex<3, fltp08>>& locations, fltp08 radius)
110 lib_assert(getChildrenByName(deployment_name).size() == 0,
"Unexpected duplicate path name");
111 Model hole_data = createChild();
112 Deployment deployment(hole_data);
113 deployment.addSegments(locations);
114 deployment.setProperty(DesignObject::e_name, deployment_name);
115 deployment.setUseTube(Geometry::ThicknessMode::e_pixel, radius);
118 void addHolePath(
const String& deployment_name,
const Buffer<fltp08>& depths, fltp08 radius)
120 Buffer<Vertex<3, fltp08>> new_data(depths.size());
121 Vertex<3, fltp08> collar_location = getLocation();
122 for (uint04 i = 0; i < depths.size(); i++)
124 new_data.add(Vertex<3, fltp08>(collar_location[X], collar_location[Y], depths[i]));
126 addHolePath(deployment_name, new_data, radius);
128 void setPathVisible(
const String& deployment_name,
bool visible)
130 Buffer<Model> children = getChildrenByName(deployment_name);
131 lib_assert(children.size() == 1,
"Bad deployment name");
132 if (children.size() != 1)
134 children[0].setDesignVisible(visible);
137 void colorBy(
const String& property, fltp08 min, fltp08 mid, fltp08 max)
139 Material mat = getMaterial(PrimitiveProperty::Solid);
140 mat.setUVMode(UVType::e_KD, Material::UVMode::e_scaled_channel);
141 mat.setMaterialProperty(Material::e_extra_property_value_max, min);
142 mat.setMaterialProperty(Material::e_extra_property_value_mid, mid);
143 mat.setMaterialProperty(Material::e_extra_property_value_min, max);
144 mat.setMaterialProperty(Material::e_draw_by_property_channel, property);
145 mat.setProperty(DesignProperty::e_modified_time, Time::SystemTime());
147 void colorBy(
const String& property)
149 Material mat = getMaterial(PrimitiveProperty::Solid);
150 colorByChannel(mat, property);
#define lib_assert(expression, message)
Definition LibAssert.h:61
constexpr bool IsInvalid(const t_type &value)
Query if 'value' is valid or invalid. Invalid values should return invalid if used for calculations o...
Definition BaseFunctions.hpp:170