@@ -177,13 +177,6 @@ class CFrontendIR : public CNodePool
177
177
virtual _TypedHandle<IExprNode> getChildHandle_impl (const uint8_t ix) const = 0;
178
178
};
179
179
180
- // ! Base class for leaf node
181
- class IExprLeaf : public IExprNode
182
- {
183
- public:
184
- inline uint8_t getChildCount () const override final {return 0 ;}
185
- };
186
-
187
180
// ! Base class for leaf node quantities which contribute additively to the Lighting Integral
188
181
class IContributor : public IExprNode
189
182
{
@@ -192,9 +185,10 @@ class CFrontendIR : public CNodePool
192
185
};
193
186
194
187
// This node could also represent non directional emission, but we have another node for that
195
- class CSpectralVariable final : public IExprLeaf
188
+ class CSpectralVariable final : public IExprNode
196
189
{
197
190
public:
191
+ inline uint8_t getChildCount () const override final { return 0 ; }
198
192
inline const std::string_view getTypeName () const override {return " nbl::CSpectralVariable" ;}
199
193
// Variable length but has no children
200
194
@@ -256,6 +250,7 @@ class CFrontendIR : public CNodePool
256
250
std::destroy_n (pWonky->knots .params ,getKnotCount ());
257
251
}
258
252
253
+ inline _TypedHandle<IExprNode> getChildHandle_impl (const uint8_t ix) const override {return {};}
259
254
inline bool invalid (const SInvalidCheckArgs& args) const override
260
255
{
261
256
auto pWonky = reinterpret_cast <const SCreationParams<1 >*>(this +1 );
@@ -465,13 +460,17 @@ class CFrontendIR : public CNodePool
465
460
class CDeltaTransmission final : public IBxDF
466
461
{
467
462
public:
463
+ inline uint8_t getChildCount () const override {return 0 ;}
468
464
inline const std::string_view getTypeName () const override {return " nbl::CDeltaTransmission" ;}
469
465
static inline uint32_t calc_size ()
470
466
{
471
467
return sizeof (CDeltaTransmission);
472
468
}
473
469
inline uint32_t getSize () const override {return calc_size ();}
474
470
inline CDeltaTransmission () = default;
471
+
472
+ protected:
473
+ inline _TypedHandle<IExprNode> getChildHandle_impl (const uint8_t ix) const override {return {};}
475
474
};
476
475
// Because of Schussler et. al 2017 every one of these nodes splits into 2 (if no L dependence) or 3 during canonicalization
477
476
class COrenNayar final : public IBxDF
@@ -571,6 +570,22 @@ class CFrontendIR : public CNodePool
571
570
protected:
572
571
using CNodePool::CNodePool;
573
572
573
+ inline core::string getNodeID (const TypedHandle<const INode> handle) const {return core::string (" _" )+std::to_string (handle.untyped .value );}
574
+ inline core::string getLabelledNodeID (const TypedHandle<const INode> handle) const
575
+ {
576
+ const INode* node = deref (handle);
577
+ core::string retval = getNodeID (handle);
578
+ retval += " [label=\" " ;
579
+ retval += node->getTypeName ();
580
+ if (const auto * debug=deref (node->debugInfo ); debug && !debug->data ().empty ())
581
+ {
582
+ retval += " \\ n" ;
583
+ retval += std::string_view (reinterpret_cast <const char *>(debug->data ().data ()),debug->data ().size ());
584
+ }
585
+ retval += " \" ]" ;
586
+ return retval;
587
+ }
588
+
574
589
core::vector<TypedHandle<const CLayer>> m_rootNodes;
575
590
};
576
591
0 commit comments