Skip to content

Commit 75905c8

Browse files
committed
Merge branch 'Jordan08-dev-clean-v2-52' into codac2_dev
2 parents a6fee67 + 9a47c60 commit 75905c8

9 files changed

Lines changed: 25 additions & 24 deletions

File tree

‎src/core/domains/interval/codac2_Interval_impl.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ namespace codac2
624624

625625
inline Interval operator""_i(long double x)
626626
{
627-
return Interval(x);
627+
return Interval(static_cast<double>(x));
628628
}
629629

630630
inline double prev_float(double x)

‎src/core/functions/analytic/codac2_analytic_constants.h‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,14 @@ namespace codac2
6565
if constexpr(std::is_same_v<T,ScalarType>)
6666
return {1,1};
6767

68-
if constexpr(std::is_same_v<T,VectorType>)
68+
else if constexpr(std::is_same_v<T,VectorType>)
6969
return {_x.size(),1};
7070

71-
if constexpr(std::is_same_v<T,MatrixType>)
71+
else if constexpr(std::is_same_v<T,MatrixType>)
7272
return {_x.rows(),_x.cols()};
73-
74-
assert_release_constexpr(false && "unknow output shape for constant");
73+
74+
else
75+
assert_release_constexpr(false && "unknow output shape for constant");
7576
}
7677

7778
void replace_arg([[maybe_unused]] const ExprID& old_arg_id, [[maybe_unused]] const std::shared_ptr<ExprBase>& new_expr)

‎src/core/operators/codac2_pow.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,6 @@ namespace codac2
139139
{
140140
assert_release(x2.is_degenerated() && "PowOp::bwd(y,x1,x2) (with x1 and x2 intervals) not implemented yet with Gaol");
141141
assert_release(x2 == (int)(x2.mid()) && "PowOp::bwd(y,x1,x2) (x2 not integer) not implemented yet with Gaol");
142-
PowOp::bwd(y, x1, x2.mid());
142+
PowOp::bwd(y, x1, (int)(x2.mid()));
143143
}
144144
}

‎src/graphics/3rd/vibes/vibes.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,10 +391,10 @@ namespace vibes {
391391
/// The color used for transparency is throw the pen color
392392
VIBES_FUNC_COLOR_PARAM_5(drawRaster, const std::string&, rasterFilename,
393393
const double &,ulb, const double &, yub,
394-
const double &,width, const double &, height);
394+
const double &,width, const double &, height)
395395
VIBES_FUNC_COLOR_PARAM_6(drawRaster, const std::string&, rasterFilename,
396396
const double &,ulb, const double &, yub,
397-
const double &,width, const double &, height, const double &, rot);
397+
const double &,width, const double &, height, const double &, rot)
398398

399399
/// Draw a Cake at position (cx,cy)
400400
VIBES_FUNC_COLOR_PARAM_4(drawCake,const double &,cx, const double &,cy, const double &,rot, const double &,length)

‎src/graphics/figures/codac2_Figure2D.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ void Figure2D::draw_tube(const SlicedTube<IntervalVector>& x, const StyleGradien
517517
{
518518
draw_tube_common(*this, x, max_nb_slices_to_display,
519519
[&style](const Interval& tube_t0tf, std::list<TSlice>::reverse_iterator it) {
520-
auto c = style.cmap.color((it->mid()-tube_t0tf.lb())/tube_t0tf.diam());
520+
auto c = style.cmap.color(static_cast<float>((it->mid()-tube_t0tf.lb())/tube_t0tf.diam()));
521521
return StyleProperties({c,c}, style.layer, style.line_style, "w:"+to_string(style.line_width), "z:"+to_string(style.z_value));
522522
});
523523
}

‎src/graphics/figures/codac2_Figure3D.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ namespace codac2
206206
* \param style Style (color)
207207
*/
208208
void draw_plane(const Vector &c, const Matrix &A, bool yaw_is_up=true,
209-
const StyleProperties& style = { Color::dark_gray(0.8) });
209+
const StyleProperties& style = { Color::dark_gray(0.8f) });
210210

211211

212212
// Pavings
@@ -228,7 +228,7 @@ namespace codac2
228228
* \param in_style Style of the inside of the paving
229229
*/
230230
void draw_paving(const PavingInOut& p,
231-
const StyleProperties& bound_style = { Color::yellow(0.3), "paving_bound" },
231+
const StyleProperties& bound_style = { Color::yellow(0.3f), "paving_bound" },
232232
const StyleProperties& in_style = { Color::green(0.5) , "paving_in" });
233233

234234
/**

‎src/graphics/styles/codac2_Color.cpp‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ Color Color::rgb() const
6767
float r = 0., g = 0., b = 0.;
6868

6969
// Normalisation des valeurs
70-
float h = (*this)[0] / 360.; // Hue normalisée (0 à 1)
71-
float s = (*this)[1] / 100.; // Saturation normalisée (0 à 1)
72-
float v = (*this)[2] / 100.; // Value normalisée (0 à 1)
70+
float h = (*this)[0] / 360.f; // Hue normalisée (0 à 1)
71+
float s = (*this)[1] / 100.f; // Saturation normalisée (0 à 1)
72+
float v = (*this)[2] / 100.f; // Value normalisée (0 à 1)
7373

7474
int i = static_cast<int>(h * 6);
7575
float f = (h * 6) - i;
@@ -93,7 +93,7 @@ Color Color::rgb() const
9393
g *= 255.;
9494
b *= 255.;
9595

96-
return Color({r, g, b,std::min<float>(255.,((*this)[3]*2.55))},Model::RGB);
96+
return Color({r, g, b,std::min<float>(255.f,((*this)[3]*2.55f))},Model::RGB);
9797
}
9898
}
9999

@@ -103,21 +103,21 @@ Color Color::hsv() const
103103
return *this;
104104
else
105105
{
106-
float r = (*this)[0]/255.;
107-
float g = (*this)[1]/255.;
108-
float b = (*this)[2]/255.;
106+
float r = (*this)[0]/255.f;
107+
float g = (*this)[1]/255.f;
108+
float b = (*this)[2]/255.f;
109109
float c_max = std::max({r, g, b});
110110
float c_min = std::min({r, g, b});
111111
float delta = c_max - c_min;
112112

113113
float h = 0.0;
114114
if (delta != 0) {
115115
if (c_max == r) {
116-
h = fmod((g - b) / delta, 6.0);
116+
h = std::fmod((g - b) / delta, 6.0f);
117117
} else if (c_max == g) {
118-
h = (b - r) / delta + 2.0;
118+
h = (b - r) / delta + 2.0f;
119119
} else if (c_max == b) {
120-
h = (r - g) / delta + 4.0;
120+
h = (r - g) / delta + 4.0f;
121121
}
122122
h /= 6.0;
123123
if (h < 0) {
@@ -133,7 +133,7 @@ Color Color::hsv() const
133133
s*=100.;
134134
v*=100.;
135135

136-
return Color({h, s, v,std::min<float>(100.,((*this)[3]/2.55))},Model::HSV);
136+
return Color({h, s, v,std::min<float>(100.f,((*this)[3]/2.55f))},Model::HSV);
137137
}
138138
}
139139

‎src/graphics/styles/codac2_ColorMap.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Color ColorMap::color(float r) const
2424
assert(Interval(0.,1.).contains(r));
2525

2626
Interval map_domain = Interval(this->begin()->first,prev(this->end())->first);
27-
float real_index = map_domain.lb() + r*map_domain.diam();
27+
float real_index = static_cast<float>(map_domain.lb() + r*map_domain.diam());
2828

2929
if(this->find(real_index) == this->end()) // color interpolation
3030
{

‎src/graphics/styles/codac2_ColorMap.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ namespace codac2
160160
int i = 0;
161161
for(int h = 300 ; h > 0 ; h-=10)
162162
{
163-
cmap[i]=Color({(float)h,100.,100.,100.f*alpha},Model::HSV);
163+
cmap[(float)i]=Color({(float)h,100.,100.,100.f*alpha},Model::HSV);
164164
i++;
165165
}
166166
return cmap;

0 commit comments

Comments
 (0)