// function to mark the output dirty once one of the dynamic attributes changes MStatus puttyNode::setDependentsDirty( const MPlug &plugBeingDirtied, MPlugArray &affectedPlugs ) { if ( plugBeingDirtied.isDynamic()) { MStatus status; MObject thisNode = thisMObject(); // there is a dynamic attribute that is is dirty, so mark // the outputGeometry dirty if ( MStatus::kSuccess == status ) { // cerr << "\n###" << plugBeingDirtied.name() <<" "<<output.name(); // MPlug pB( thisNode, puttyNode::outputGeom ); // affectedPlugs.append( pB ); MPlug pD( thisNode, puttyNode::aDynDirty ); pD.setValue(true); // affectedPlugs.append( output ); } } return( MS::kSuccess ); }
int main() { { cout<<"---------------------"<<endl; my_shared_ptr<Base> p(new Base(5)); my_shared_ptr<Base> p1(p); my_shared_ptr<Base> p2 = p1; } { cout<<"---------------------"<<endl; my_shared_ptr<Derived> pD(new Derived(5)); (*pD).func(); my_shared_ptr<Base> pB = pD; pB->func(); my_shared_ptr<Derived> pD1 = dynamic_ptr_cast<Derived>(pB); pD1->func(); } { cout<<"---------------------"<<endl; my_shared_ptr<Base> pB; if(!pB) cout<<"pB is nullptr"<<endl; //int i = pB; //cannot BOOL_SUBST b = pB; //虽然这样可以通过编译,但也造不成什么伤害了 //cout<<i<<endl; } }
void PropertyTable::addProperty(const QString &name, const QVariant &value, const QVariant &defaultValue) { Property pD(name, value, defaultValue); m_properties[name] = pD; }