Skip to content

Commit 960baa9

Browse files
v2.2.9 added constructors to shade factories for python bindings.
1 parent b91518f commit 960baa9

File tree

3 files changed

+87
-37
lines changed

3 files changed

+87
-37
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.5)
22

3-
project( wincalc VERSION 2.2.8 LANGUAGES CXX )
3+
project( wincalc VERSION 2.2.9 LANGUAGES CXX )
44
set(LIB_NAME ${PROJECT_NAME})
55

66
if(NOT "${CMAKE_CXX_STANDARD}")

src/product_data.cpp

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,10 @@ namespace wincalc
223223
front_openness_calcs[Perforated_Geometry::Type::SQUARE] = [=]() {
224224
return ThermalPermeability::Perforated::openness(
225225
ThermalPermeability::Perforated::Geometry::Square,
226-
geometry.spacing_x,
227-
geometry.spacing_y,
228-
geometry.dimension_x,
229-
geometry.dimension_x);
226+
geometry.spacing_x,
227+
geometry.spacing_y,
228+
geometry.dimension_x,
229+
geometry.dimension_x);
230230
};
231231

232232
auto front_openness_calc = front_openness_calcs.find(geometry.perforation_type);
@@ -235,9 +235,8 @@ namespace wincalc
235235
{
236236
std::stringstream msg;
237237
msg << "Unsupported perforation type: "
238-
<< static_cast<
239-
std::underlying_type<Perforated_Geometry::Type>::type>(
240-
geometry.perforation_type);
238+
<< static_cast<std::underlying_type<Perforated_Geometry::Type>::type>(
239+
geometry.perforation_type);
241240
throw std::runtime_error(msg.str());
242241
}
243242

@@ -332,4 +331,39 @@ namespace wincalc
332331
rf_visible(rf_visible),
333332
rb_visible(rb_visible)
334333
{}
334+
Venetian_Geometry::Venetian_Geometry(double slat_tilt,
335+
double slat_width,
336+
double slat_spacing,
337+
double slat_curvature,
338+
bool is_horizontal,
339+
SingleLayerOptics::DistributionMethod distribution_method,
340+
int number_slat_segments) :
341+
slat_tilt(slat_tilt),
342+
slat_width(slat_width),
343+
slat_spacing(slat_spacing),
344+
slat_curvature(slat_curvature),
345+
is_horizontal(is_horizontal),
346+
distribution_method(distribution_method),
347+
number_slat_segments(number_slat_segments)
348+
{}
349+
350+
Woven_Geometry::Woven_Geometry(double thread_diameter,
351+
double thread_spacing,
352+
double shade_thickness) :
353+
thread_diameter(thread_diameter),
354+
thread_spacing(thread_spacing),
355+
shade_thickness(shade_thickness)
356+
{}
357+
358+
Perforated_Geometry::Perforated_Geometry(double spacing_x,
359+
double spacing_y,
360+
double dimension_x,
361+
double dimension_y,
362+
Perforated_Geometry::Type perforation_type) :
363+
spacing_x(spacing_x),
364+
spacing_y(spacing_y),
365+
dimension_x(dimension_x),
366+
dimension_y(dimension_y),
367+
perforation_type(perforation_type)
368+
{}
335369
} // namespace wincalc

src/product_data.h

Lines changed: 45 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -222,21 +222,30 @@ namespace wincalc
222222

223223
struct Venetian_Geometry
224224
{
225+
Venetian_Geometry(double slat_tilt,
226+
double slat_width,
227+
double slat_spacing,
228+
double slat_curvature,
229+
bool is_horizontal = true,
230+
SingleLayerOptics::DistributionMethod distribution_method =
231+
SingleLayerOptics::DistributionMethod::DirectionalDiffuse,
232+
int number_slat_segments = 5);
233+
225234
double slat_tilt;
226235
double slat_width;
227236
double slat_spacing;
228237
double slat_curvature;
229238
bool is_horizontal = true;
230-
SingleLayerOptics::DistributionMethod distribution_method =
231-
SingleLayerOptics::DistributionMethod::DirectionalDiffuse;
232-
int number_slat_segments = 5;
239+
SingleLayerOptics::DistributionMethod distribution_method =
240+
SingleLayerOptics::DistributionMethod::DirectionalDiffuse;
241+
int number_slat_segments = 5;
233242
};
234243

235244
struct Product_Data_Optical_Venetian : Product_Data_Optical_With_Material
236245
{
237246
Product_Data_Optical_Venetian(
238247
std::shared_ptr<Product_Data_Optical> const & material_optical_data,
239-
Venetian_Geometry const& geometry);
248+
Venetian_Geometry const & geometry);
240249

241250
std::unique_ptr<EffectiveLayers::EffectiveLayer>
242251
effective_thermal_values(double width,
@@ -246,21 +255,23 @@ namespace wincalc
246255
double gap_width_left,
247256
double gap_width_right) const override;
248257

249-
Venetian_Geometry geometry;
258+
Venetian_Geometry geometry;
250259
};
251260

252-
struct Woven_Geometry
253-
{
261+
struct Woven_Geometry
262+
{
263+
Woven_Geometry(double thread_diameter, double thread_spacing, double shade_thickness);
264+
254265
double thread_diameter;
255-
double thread_spacing;
256-
double shade_thickness;
257-
};
266+
double thread_spacing;
267+
double shade_thickness;
268+
};
258269

259270
struct Product_Data_Optical_Woven_Shade : Product_Data_Optical_With_Material
260271
{
261272
Product_Data_Optical_Woven_Shade(
262273
std::shared_ptr<Product_Data_Optical> const & material_optical_data,
263-
Woven_Geometry const& geometry);
274+
Woven_Geometry const & geometry);
264275

265276
std::unique_ptr<EffectiveLayers::EffectiveLayer>
266277
effective_thermal_values(double width,
@@ -270,31 +281,36 @@ namespace wincalc
270281
double gap_width_left,
271282
double gap_width_right) const override;
272283

273-
Woven_Geometry geometry;
284+
Woven_Geometry geometry;
274285
};
275286

276-
struct Perforated_Geometry
277-
{
278-
enum class Type
279-
{
280-
CIRCULAR,
281-
RECTANGULAR,
282-
SQUARE
283-
};
284-
285-
double spacing_x;
286-
double spacing_y;
287-
double dimension_x;
288-
double dimension_y;
289-
Perforated_Geometry::Type perforation_type;
290-
};
287+
struct Perforated_Geometry
288+
{
289+
enum class Type
290+
{
291+
CIRCULAR,
292+
RECTANGULAR,
293+
SQUARE
294+
};
295+
296+
Perforated_Geometry(double spacing_x,
297+
double spacing_y,
298+
double dimension_x,
299+
double dimension_y,
300+
Perforated_Geometry::Type perforation_type);
301+
302+
double spacing_x;
303+
double spacing_y;
304+
double dimension_x;
305+
double dimension_y;
306+
Perforated_Geometry::Type perforation_type;
307+
};
291308

292309
struct Product_Data_Optical_Perforated_Screen : Product_Data_Optical_With_Material
293310
{
294-
295311
Product_Data_Optical_Perforated_Screen(
296312
std::shared_ptr<Product_Data_Optical> const & material_optical_data,
297-
Perforated_Geometry const& geometry);
313+
Perforated_Geometry const & geometry);
298314

299315
std::unique_ptr<EffectiveLayers::EffectiveLayer>
300316
effective_thermal_values(double width,

0 commit comments

Comments
 (0)