1 /**
2  * Mandelbulber v2, a 3D fractal generator  _%}}i*<.         ______
3  * Copyright (C) 2020 Mandelbulber Team   _>]|=||i=i<,      / ____/ __    __
4  *                                        \><||i|=>>%)     / /   __/ /___/ /_
5  * This file is part of Mandelbulber.     )<=i=]=|=i<>    / /__ /_  __/_  __/
6  * The project is licensed under GPLv3,   -<>>=|><|||`    \____/ /_/   /_/
7  * see also COPYING file in this folder.    ~+{i%+++
8  *
9  * abs add  constant,  z = abs( z + pre-offset) + post-offset
10  */
11 
12 #include "all_fractal_definitions.h"
13 
cFractalTransfAbsAddConstant4d()14 cFractalTransfAbsAddConstant4d::cFractalTransfAbsAddConstant4d() : cAbstractFractal()
15 {
16 	nameInComboBox = "T>Abs Add Constant 4D";
17 	internalName = "transf_abs_add_constant4d";
18 	internalID = fractal::transfAbsAddConstant4d;
19 	DEType = analyticDEType;
20 	DEFunctionType = withoutDEFunction;
21 	cpixelAddition = cpixelDisabledByDefault;
22 	defaultBailout = 100.0;
23 	DEAnalyticFunction = analyticFunctionNone;
24 	coloringFunction = coloringFunctionDefault;
25 }
26 
FormulaCode(CVector4 & z,const sFractal * fractal,sExtendedAux & aux)27 void cFractalTransfAbsAddConstant4d::FormulaCode(
28 	CVector4 &z, const sFractal *fractal, sExtendedAux &aux)
29 {
30 	Q_UNUSED(aux);
31 
32 	z += fractal->transformCommon.additionConstant0000;
33 
34 	if (fractal->transformCommon.functionEnabledx) z.x = fabs(z.x);
35 	if (fractal->transformCommon.functionEnabledy) z.y = fabs(z.y);
36 	if (fractal->transformCommon.functionEnabledz) z.z = fabs(z.z);
37 	if (fractal->transformCommon.functionEnabled) z.w = fabs(z.w);
38 
39 	z += fractal->transformCommon.offset0000;
40 }
41