コード例 #1
0
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
bool FocalMechanism::updateChild(Object* child) {
	Comment* commentChild = Comment::Cast(child);
	if ( commentChild != NULL ) {
		Comment* commentElement = comment(commentChild->index());
		if ( commentElement != NULL ) {
			*commentElement = *commentChild;
			commentElement->update();
			return true;
		}
		return false;
	}

	MomentTensor* momentTensorChild = MomentTensor::Cast(child);
	if ( momentTensorChild != NULL ) {
		MomentTensor* momentTensorElement
			= MomentTensor::Cast(PublicObject::Find(momentTensorChild->publicID()));
		if ( momentTensorElement && momentTensorElement->parent() == this ) {
			*momentTensorElement = *momentTensorChild;
			momentTensorElement->update();
			return true;
		}
		return false;
	}

	return false;
}
コード例 #2
0
ファイル: parameter.cpp プロジェクト: SeisComP3/seiscomp3
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
bool Parameter::updateChild(Object* child) {
	Comment* commentChild = Comment::Cast(child);
	if ( commentChild != NULL ) {
		Comment* commentElement = comment(commentChild->index());
		if ( commentElement != NULL ) {
			*commentElement = *commentChild;
			commentElement->update();
			return true;
		}
		return false;
	}

	return false;
}