33#include <NDEVR/StationModel.h>
35#include <NDEVR/Deployment.h>
36#include <NDEVR/Material.h>
37#include <NDEVR/Geometry.h>
46 DrillHole(
const Model& model,
const Vector<3, fltp08>& location)
56 setLocation(location);
58 DrillHole(
const Model& model)
61 if (!hasMetaData(
"drill_hole"))
63 setMetaData(
"drill_hole",
true);
69 Model drillRow()
const
71 Model model = getParent();
72 while (model.isValid())
74 if (model.isOfType(
"drill_pattern_row"))
76 model = model.getParent();
80 Model drillPattern()
const
82 Model model = getParent();
83 while (model.isValid())
85 if (model.isOfType(
"drill_pattern"))
87 model = model.getParent();
91 void addHolePath(
const String& deployment_name,
const Buffer<Vertex<3, fltp08>>& locations,
const Buffer<Time>& times, fltp08 radius)
94 lib_assert(getChildrenByName(deployment_name).size() == 0,
"Unexpected duplicate path name");
95 Model hole_data = createChild();
96 Deployment deployment(hole_data);
97 deployment.addSegments(locations, times);
98 deployment.setProperty(DesignObject::e_name, deployment_name);
100 deployment.setUseTube(Geometry::ThicknessMode::e_circle, radius);
102 deployment.setUseTube(Geometry::ThicknessMode::e_pixel, 1.0);
105 void addHolePath(
const String& deployment_name,
const Buffer<Vertex<3, fltp08>>& locations, fltp08 radius)
107 lib_assert(getChildrenByName(deployment_name).size() == 0,
"Unexpected duplicate path name");
108 Model hole_data = createChild();
109 Deployment deployment(hole_data);
110 deployment.addSegments(locations);
111 deployment.setProperty(DesignObject::e_name, deployment_name);
112 deployment.setUseTube(Geometry::ThicknessMode::e_pixel, radius);
115 void addHolePath(
const String& deployment_name,
const Buffer<fltp08>& depths, fltp08 radius)
117 Buffer<Vertex<3, fltp08>> new_data(depths.size());
118 Vertex<3, fltp08> collar_location = getLocation();
119 for (uint04 i = 0; i < depths.size(); i++)
121 new_data.add(Vertex<3, fltp08>(collar_location[X], collar_location[Y], depths[i]));
123 addHolePath(deployment_name, new_data, radius);
125 void setPathVisible(
const String& deployment_name,
bool visible)
127 Buffer<Model> children = getChildrenByName(deployment_name);
128 lib_assert(children.size() == 1,
"Bad deployment name");
129 if (children.size() != 1)
131 children[0].setDesignVisible(visible);
134 void colorBy(
const String& property, fltp08 min, fltp08 mid, fltp08 max)
136 Material mat = getMaterial(PrimitiveProperty::Solid);
137 mat.setUVMode(UVType::e_KD, Material::UVMode::e_scaled_channel);
138 mat.setMaterialProperty(Material::e_extra_property_value_max, min);
139 mat.setMaterialProperty(Material::e_extra_property_value_mid, mid);
140 mat.setMaterialProperty(Material::e_extra_property_value_min, max);
141 mat.setMaterialProperty(Material::e_draw_by_property_channel, property);
142 mat.setProperty(DesignProperty::e_modified_time, Time::SystemTime());
144 void colorBy(
const String& property)
146 Material mat = getMaterial(PrimitiveProperty::Solid);
147 colorByChannel(mat, property);
#define lib_assert(expression, message)
Asserts some logic in the code. Disabled in non debug mode by default. Can be re-enabled in release u...
Definition LibAssert.h:70
constexpr bool isNaN(const t_type &value)
Query if 'value' is valid or invalid.
Definition BaseFunctions.hpp:200