add option to do orthographic projection

This commit is contained in:
Gavin Ridley 2021-12-16 17:24:32 -05:00
parent d51fd873ab
commit 76cc722090
3 changed files with 65 additions and 12 deletions

View file

@ -274,9 +274,6 @@ public:
class ProjectionPlot : public PlottableInterface {
// TODO add optional choice between perspective or orthographic
// TODO add optionl to turn off wireframe
public:
ProjectionPlot(pugi::xml_node plot);
@ -290,6 +287,7 @@ private:
void set_field_of_view(pugi::xml_node node);
void set_pixels(pugi::xml_node node);
void set_opacities(pugi::xml_node node);
void set_orthographic_width(pugi::xml_node node);
/* Used for drawing wireframe and colors. We record the list of
* surface/cell/material intersections and the corresponding lengths as a ray
@ -316,6 +314,12 @@ private:
Direction up_ {0.0, 0.0, 1.0}; // which way is up
bool wireframe_; // draw wireframe around ID boundaries (material or cell
// based on color_by)
/* The horizontal thickness, if using an orthographic projection.
* If set to zero, we assume using a perspective projection.
*/
double orthographic_width_ {0.0};
RGBColor wireframe_color_ {BLACK}; // wireframe color
std::vector<double>
xs_; // macro cross section values for cell volume rendering
@ -332,6 +336,9 @@ private:
*/
static bool trackstack_equivalent(const std::vector<TrackSegment>& track1,
const std::vector<TrackSegment>& track2);
// Closed form 3x3 matrix inversion
static std::vector<double> invert_matrix(const std::vector<double>& input);
};
//===============================================================================