void* _ElementCellLayout_Copy( void* elementCellLayout, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
	ElementCellLayout*	self = (ElementCellLayout*)elementCellLayout;
	ElementCellLayout*	newElementCellLayout;
	PtrMap*			map = ptrMap;
	Bool			ownMap = False;
	
	if( !map ) {
		map = PtrMap_New( 10 );
		ownMap = True;
	}
	
	newElementCellLayout = _CellLayout_Copy( self, dest, deep, nameExt, ptrMap );
	
	if( deep ) {
		newElementCellLayout->mesh = (Mesh*)Stg_Class_Copy( self->mesh, NULL, deep, nameExt, map );
	}
	else {
		newElementCellLayout->mesh = self->mesh;
	}
	
	if( ownMap ) {
		Stg_Class_Delete( map );
	}
	
	return (void*)newElementCellLayout;
}
void* _TriSingleCellLayout_Copy( void* triSingleCellLayout, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
	TriSingleCellLayout*	self = (TriSingleCellLayout*)triSingleCellLayout;
	TriSingleCellLayout*	newTriSingleCellLayout;
	
	newTriSingleCellLayout = _CellLayout_Copy( self, dest, deep, nameExt, ptrMap );
	
	newTriSingleCellLayout->dictionary = self->dictionary;
	newTriSingleCellLayout->dim = self->dim;
	
	return (void*)newTriSingleCellLayout;
}
Пример #3
0
void* _SingleCellLayout_Copy( void* singleCellLayout, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
	SingleCellLayout*	self = (SingleCellLayout*)singleCellLayout;
	SingleCellLayout*	newSingleCellLayout;
	PtrMap*			map = ptrMap;
	Bool			ownMap = False;
	
	if( !map ) {
		map = PtrMap_New( 10 );
		ownMap = True;
	}
	
	newSingleCellLayout = _CellLayout_Copy( self, dest, deep, nameExt, ptrMap );
	
	newSingleCellLayout->dimExists[0] = self->dimExists[0];
	newSingleCellLayout->dimExists[1] = self->dimExists[1];
	newSingleCellLayout->dimExists[2] = self->dimExists[2];
	newSingleCellLayout->min[0] = self->min[0];
	newSingleCellLayout->min[1] = self->min[1];
	newSingleCellLayout->min[2] = self->min[2];
	newSingleCellLayout->max[0] = self->max[0];
	newSingleCellLayout->max[1] = self->max[1];
	newSingleCellLayout->max[2] = self->max[2];
	newSingleCellLayout->pointCount = self->pointCount;
	
	if( deep ) {
		if( (newSingleCellLayout->cellPointCoords = PtrMap_Find( map, self->cellPointCoords )) == NULL && self->cellPointCoords ) {
			newSingleCellLayout->cellPointCoords = Memory_Alloc_Array( Coord, newSingleCellLayout->pointCount, "SingleCellLayout->cellPoints" );
			memcpy( newSingleCellLayout->cellPointCoords, self->cellPointCoords, sizeof(Coord) * newSingleCellLayout->pointCount );
			PtrMap_Append( map, self->cellPointCoords, newSingleCellLayout->cellPointCoords );
		}
	}
	else {
		newSingleCellLayout->cellPointCoords = self->cellPointCoords;
	}
	
	if( ownMap ) {
		Stg_Class_Delete( map );
	}
	
	return (void*)newSingleCellLayout;
}