mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 13:15:39 -04:00
add option to do orthographic projection
This commit is contained in:
parent
d51fd873ab
commit
76cc722090
3 changed files with 65 additions and 12 deletions
|
|
@ -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);
|
||||
};
|
||||
|
||||
//===============================================================================
|
||||
|
|
|
|||
|
|
@ -83,6 +83,11 @@ struct Position {
|
|||
return x * other.x + y * other.y + z * other.z;
|
||||
}
|
||||
inline double norm() const { return std::sqrt(x * x + y * y + z * z); }
|
||||
inline Position cross(Position other) const
|
||||
{
|
||||
return {y * other.z - z * other.y, z * other.x - x * other.z,
|
||||
x * other.y - y * other.x};
|
||||
}
|
||||
|
||||
//! Reflect a direction across a normal vector
|
||||
//! \param[in] other Vector to reflect across
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue