[Bf-blender-cvs] [4ea77429736] master: Refactor: Remove friend class from Cycles viewport parameters
Sergey Sharybin
noreply at git.blender.org
Thu May 27 11:55:10 CEST 2021
Commit: 4ea77429736737bf074d4294276e4cdcfce87ff9
Author: Sergey Sharybin
Date: Thu May 27 11:07:58 2021 +0200
Branches: master
https://developer.blender.org/rB4ea77429736737bf074d4294276e4cdcfce87ff9
Refactor: Remove friend class from Cycles viewport parameters
Such pattern should only be used when it is really needed. Otherwise
just stick to a more regular design, without worrying who is the user
of the class. Otherwise it will be annoying to subclass or unit test.
===================================================================
M intern/cycles/blender/blender_viewport.h
===================================================================
diff --git a/intern/cycles/blender/blender_viewport.h b/intern/cycles/blender/blender_viewport.h
index 5939076979a..08ef6a9e679 100644
--- a/intern/cycles/blender/blender_viewport.h
+++ b/intern/cycles/blender/blender_viewport.h
@@ -28,7 +28,7 @@
CCL_NAMESPACE_BEGIN
class BlenderViewportParameters {
- private:
+ public:
bool use_scene_world;
bool use_scene_lights;
float studiolight_rotate_z;
@@ -37,13 +37,11 @@ class BlenderViewportParameters {
ustring studiolight_path;
BlenderViewportParameters();
- BlenderViewportParameters(BL::SpaceView3D &b_v3d);
+ explicit BlenderViewportParameters(BL::SpaceView3D &b_v3d);
const bool modified(const BlenderViewportParameters &other) const;
const bool custom_viewport_parameters() const;
- friend class BlenderSync;
- public:
/* Retrieve the render pass type that needs to be displayed on the given `SpaceView3D`
* When the `b_v3d` parameter is not given `PASS_NONE` will be returned. */
static PassType get_render_pass(BL::SpaceView3D &b_v3d);
More information about the Bf-blender-cvs
mailing list