Skip to content

Commit

Permalink
cleanups; remove the 'export multiplier' concept
Browse files Browse the repository at this point in the history
  • Loading branch information
EffinMaggie committed Dec 14, 2013
1 parent 83bd5dc commit 812185b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 103 deletions.
12 changes: 0 additions & 12 deletions include/topologic/arguments.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ namespace topologic
" --flame-variants N Suggest that random fractal flames should use N variants\n"
"\n"
" --precision F Set model precision to F\n"
" --multiplier F Set model export precision multiplier to F\n"
" --radius F Set model radius parameter to F\n"
"\n"
" --background R G B A Set background colour to R G B A (use values between 0 and 1)\n"
Expand Down Expand Up @@ -217,17 +216,6 @@ namespace topologic
topologicState.state<Q,2>::parameter.polarRadius = Q(dv);
}
}
else if (arg == "--multiplier")
{
i++;
if (i < argc)
{
std::stringstream st (argv[i]);
double dv;
st >> dv;
topologicState.state<Q,2>::exportMultiplier = Q(dv);
}
}
else if (arg == "--background")
{
i++;
Expand Down
4 changes: 0 additions & 4 deletions include/topologic/parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -739,10 +739,6 @@ namespace topologic
{
s.parameter.polarPrecision = Q(stringToDouble(value));
}
if ((value = parser.evaluate("//topologic:precision/@export-multiplier")) != "")
{
s.exportMultiplier = Q(stringToDouble(value));
}
if ((value = parser.evaluate("//topologic:options/@radius")) != "")
{
s.parameter.polarRadius = Q(stringToDouble(value));
Expand Down
76 changes: 4 additions & 72 deletions include/topologic/render.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,7 @@ namespace topologic
common(stateType &pState, renderType &pRender)
: gState(pState),
object(pRender,
gState.parameter,
gState.exportMultiplier)
gState.parameter)
{}

/**\brief Construct with global state, renderer and parameters
Expand All @@ -231,31 +230,7 @@ namespace topologic
common(stateType &pState, renderType &pRender, const efgy::geometry::parameters<Q> &pParameter)
: gState(pState),
object(pRender,
pParameter,
gState.exportMultiplier)
{}

/**\brief Construct with global state, renderer, parameters and
* quality multiplier
*
* Like the three-parameter constructor, but additionally uses
* a custom quality multiplier. Used, for example, when
* providing different quality settings for the OpenGL and the
* SVG renderers.
*
* \param[in,out] pState The global topologic::state
* instance
* \param[in,out] pRender An appropriate renderer instance
* \param[in] pParameter The parameter instance to use
* \param[in] pMultiplier A multiplier which is applied to
* the quality setting by some
* models.
*/
common(stateType &pState, renderType &pRender, const efgy::geometry::parameters<Q> &pParameter, const Q &pMultiplier)
: gState(pState),
object(pRender,
pParameter,
pMultiplier)
pParameter)
{}

unsigned int depth (void) const
Expand Down Expand Up @@ -379,26 +354,6 @@ namespace topologic
wrapper(stateType &pState, const efgy::geometry::parameters<Q> &pParameter)
: parent(pState, pState.svg, pParameter) {}

/**\brief Construct with global state and custom parameters and
* quality multiplier.
*
* Initialises an SVG renderer with a global topologic::state
* instance. Additionally, instead of using the global state's
* parameter instance, this constructor substitutes the given
* 'pParameter'. The quality multiplier provided by the global
* state is also ignored in favour of the one provided as the
* third argument to this constructor.
*
* \param[in,out] pState Global topologic state object to
* use
* \param[in] pParameter The model parameters to
* substitute for the ones in the
* global state
* \param[in] pMultiplier The quality multiplier to use
*/
wrapper(stateType &pState, const efgy::geometry::parameters<Q> &pParameter, const Q &pMultiplier)
: parent(pState, pState.svg, pParameter, pMultiplier) {}

std::stringstream &render (bool updateMatrix = false)
{
if (updateMatrix)
Expand Down Expand Up @@ -484,7 +439,7 @@ namespace topologic
* \param[in,out] pState Global topologic state object to use
*/
wrapper(stateType &pState)
: parent(pState, pState.opengl, pState.parameter, Q(1))
: parent(pState, pState.opengl, pState.parameter)
{
gState.opengl.prepared = false;
}
Expand All @@ -502,30 +457,7 @@ namespace topologic
* for the ones in the global state
*/
wrapper(stateType &pState, const efgy::geometry::parameters<Q> &pParameter)
: parent(pState, pState.opengl, pParameter, Q(1))
{
gState.opengl.prepared = false;
}

/**\brief Construct with global state and custom parameters and
* quality multiplier.
*
* Initialises an OpenGL renderer with a global
* topologic::state instance. Additionally, instead of using
* the global state's parameter instance, this constructor
* substitutes the give 'pParameter'. The quality multiplier
* provided by the global state is also ignored in favour of
* the one provided as the third argument to this constructor.
*
* \param[in,out] pState Global topologic state object to
* use
* \param[in] pParameter The model parameters to
* substitute for the ones in the
* global state
* \param[in] pMultiplier The quality multiplier to use
*/
wrapper(stateType &pState, const efgy::geometry::parameters<Q> &pParameter, const Q &pMultiplier)
: parent(pState, pState.opengl, pParameter, pMultiplier)
: parent(pState, pState.opengl, pParameter)
{
gState.opengl.prepared = false;
}
Expand Down
11 changes: 1 addition & 10 deletions include/topologic/state.h
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,6 @@ namespace topologic
#if !defined(NO_OPENGL)
opengl(transformation),
#endif
exportMultiplier(Q(2)),
background(Q(0.45), Q(0.45), Q(0.65), Q(1)),
wireframe(Q(1), Q(1), Q(1), Q(1)),
surface(Q(1), Q(1), Q(1), Q(0.1)),
Expand Down Expand Up @@ -695,7 +694,7 @@ namespace topologic
rv << "<t:model type='" << model->id() << "' depth='" << model->depth() << "D' render-depth='" << model->renderDepth() << "D'/>";
}
rv << "<t:options radius='" << double(parameter.polarRadius) << "'/>"
<< "<t:precision polar='" << double(parameter.polarPrecision) << "' export-multiplier='" << double(exportMultiplier) << "'/>"
<< "<t:precision polar='" << double(parameter.polarPrecision) << "'/>"
<< "<t:ifs iterations='" << parameter.iterations << "' seed='" << parameter.seed << "' functions='" << parameter.functions << "' pre-rotate='" << (parameter.preRotate ? "yes" : "no") << "' post-rotate='" << (parameter.postRotate ? "yes" : "no") << "'/>"
<< "<t:flame coefficients='" << parameter.flameCoefficients << "'/>"
<< "<t:colour-background red='" << double(background.red) << "' green='" << double(background.green) << "' blue='" << double(background.blue) << "' alpha='" << double(background.alpha) << "'/>"
Expand Down Expand Up @@ -902,14 +901,6 @@ namespace topologic
*/
efgy::geometry::parameters<Q> parameter;

/**\brief Output export multiplier
*
* A factor that is applied to any applicable quality setting for the
* purpose of rendering stills of a scene, as opposed to live renders
* with OpenGL.
*/
Q exportMultiplier;

/**\brief Background colour
*
* The colour that is used as a rendered image's background.
Expand Down
5 changes: 0 additions & 5 deletions src/topologic.1
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ to
Set the precision parameter for certain models to
.I F
; higher precisions will result in smoother surface but larger files.
.IP "--multiplier F"
Set the export multiplier to
.I F
; this binary only produces exports, so this multiplier is always applied to
those models that use the precision parameter.
.IP "--radius F"
Set the radius parameter for certain models to
.I F
Expand Down

0 comments on commit 812185b

Please sign in to comment.