예제 #1
0
//------------------------------------------------------------------ copy_objects
void Compound::copy_objects(const vector<GeometricObject*>& rhs_ojects) {
    delete_objects();
    size_t num_objects = rhs_ojects.size();

    for (size_t j = 0; j < num_objects; j++)
        objects.push_back(rhs_ojects[j]->clone());
}
예제 #2
0
//------------------------------------------------------------------ destructor
World::~World(void) {	
	
	if(tracer_ptr) {
		delete tracer_ptr;
		tracer_ptr = NULL;
	}
	
		
	if (ambient_ptr) {
		delete ambient_ptr;
		ambient_ptr = NULL;
	}
			
		
	if (camera_ptr) {
		delete camera_ptr;
		camera_ptr = NULL;
	}

	if (random) {
		delete random;
		random = NULL;
	}
	
	delete_objects();	
	delete_lights();	
}
예제 #3
0
void TMAVectorBase::clear(void)
{
    delete_objects();
    if (CItems) delete CItems;
    CItems = new PMAObject[il_initsize];
    for (int i=0;i<il_initsize;i++) CItems[i]=NULL;
    il_vsize=il_initsize;
    il_count=0;
}
예제 #4
0
//@destroys the world
World::~World(void)
{
   if (camera_ptr) {
      delete camera_ptr;
      camera_ptr = NULL;
   }
   delete_objects();
   delete_lights();
}
예제 #5
0
void
BeveledBoxShell::copy_objects(const vector<Instance*>& rhs_ojects) {
	delete_objects();    	
	int num_objects = rhs_ojects.size();
	
	for (int j = 0; j < num_objects; j++)
		parts.push_back(rhs_ojects[j]->clone());


}
예제 #6
0
파일: field_meat.hpp 프로젝트: iirob/wire
inline
void
field<oT>::init(const uword n_rows_in, const uword n_cols_in)
  {
  arma_extra_debug_sigprint( arma_boost::format("n_rows_in = %d, n_cols_in = %d") % n_rows_in % n_cols_in );
  
  const uword n_elem_new = n_rows_in * n_cols_in;

  if(n_elem == n_elem_new)
    {
    // delete_objects();
    // create_objects();
    access::rw(n_rows) = n_rows_in;
    access::rw(n_cols) = n_cols_in;
    }
  else
    {
    delete_objects();
    
    if(n_elem > sizeof(mem_local)/sizeof(oT*) )
      {
      delete [] mem;
      }
    
    if(n_elem_new <= sizeof(mem_local)/sizeof(oT*) )
      {
      mem = mem_local;
      }
    else
      {
      mem = new(std::nothrow) oT* [n_elem_new];
      arma_check_bad_alloc( (mem == 0), "field::init(): out of memory" );
      }
    
    access::rw(n_elem) = n_elem_new;
    
    if(n_elem_new == 0)
      {
      access::rw(n_rows) = 0;
      access::rw(n_cols) = 0;
      }
    else
      {
      access::rw(n_rows) = n_rows_in;
      access::rw(n_cols) = n_cols_in;
      }
    
    create_objects();
    
    }
  
  }
bool ObjectDataObject::SetData(const wxDataFormat& format, size_t len,
  const void* buf)
{
  if (format != wxDataFormat("FaintObject")){
    return false;
  }

  // Fixme: Need a proper serialized object format.
  delete_objects(m_objects);
  Object** objects = new Object*[len / sizeof(Object*)];
  memcpy(objects, buf, len);
  for (size_t i = 0; i !=  len / sizeof(Object*); i++){
    m_objects.push_back(objects[i]->Clone());
  }
  delete[] objects;
  return true;
}
예제 #8
0
// Need PluginServer to do this.
void PluginAClientConfig::copy_from(PluginAClientConfig &that)
{
	if(total_ports != that.total_ports)
	{
		delete_objects();
		total_ports = that.total_ports;
		port_data = new LADSPA_Data[total_ports];
		port_type = new int[total_ports];
	}

	for(int i = 0; i < total_ports; i++)
	{
		port_type[i] = that.port_type[i];
		port_data[i] = that.port_data[i];
//printf("PluginAClientConfig::copy_from 1 %f %f\n", port_data[i], that.port_data[i]);
	}

}
inline
field<oT>::~field()
  {
  arma_extra_debug_sigprint_this(this);
  
  delete_objects();
  
  if(n_elem > sizeof(mem_local)/sizeof(oT*) )
    {
    delete [] mem;
    }
  
  if(arma_config::debug == true)
    {
    // try to expose buggy user code that accesses deleted objects
    mem = 0;
    }
  }
예제 #10
0
static av_cold int dvbsub_close_decoder(AVCodecContext *avctx)
{
    DVBSubContext *ctx = avctx->priv_data;
    DVBSubRegionDisplay *display;

    delete_regions(ctx);

    delete_objects(ctx);

    delete_cluts(ctx);

    av_freep(&ctx->display_definition);

    while (ctx->display_list) {
        display = ctx->display_list;
        ctx->display_list = display->next;

        av_free(display);
    }

    return 0;
}
예제 #11
0
FileThread::~FileThread()
{
	delete_objects();


}
예제 #12
0
void PluginAClientConfig::initialize(PluginServer *server)
{
	delete_objects();

	const LADSPA_Descriptor *lad_desc = server->lad_descriptor;
	const LADSPA_PortDescriptor *port_desc = lad_desc->PortDescriptors;
	const LADSPA_PortRangeHint *lad_hint = lad_desc->PortRangeHints;
	int port_count = lad_desc->PortCount;
	for(int i = 0; i < port_count; i++) {
		if( !LADSPA_IS_PORT_INPUT(port_desc[i]) ) continue;
		if( !LADSPA_IS_PORT_CONTROL(port_desc[i]) ) continue;
		++total_ports;
	}

	port_data = new LADSPA_Data[total_ports];
	port_type = new int[total_ports];

	for(int port = 0, i = 0; i < port_count; i++) {
		if( !LADSPA_IS_PORT_INPUT(port_desc[i]) ) continue;
		if( !LADSPA_IS_PORT_CONTROL(port_desc[i]) ) continue;
// Convert LAD default to default value
		float value = 0.0;
		LADSPA_PortRangeHintDescriptor hint_desc = lad_hint->HintDescriptor;

// Store type of port for GUI use
		port_type[port] = PORT_NORMAL;
		if( LADSPA_IS_HINT_SAMPLE_RATE(hint_desc) /* &&
		    LADSPA_IS_HINT_BOUNDED_ABOVE(hint_desc) &&
		    LADSPA_IS_HINT_BOUNDED_BELOW(hint_desc) */ ) // LAD frequency table
			port_type[port] = PORT_FREQ_INDEX;
		else if(LADSPA_IS_HINT_TOGGLED(hint_desc))
			port_type[port] = PORT_TOGGLE;
		else if(LADSPA_IS_HINT_INTEGER(hint_desc))
			port_type[port] = PORT_INTEGER;

// Get default of port using crazy hinting system
		if( LADSPA_IS_HINT_DEFAULT_0(hint_desc) )
			value = 0.0;
		else if( LADSPA_IS_HINT_DEFAULT_1(hint_desc) )
			value = 1.0;
		else if( LADSPA_IS_HINT_DEFAULT_100(hint_desc) )
			value = 100.0;
		else if( LADSPA_IS_HINT_DEFAULT_440(hint_desc) )
			value = port_type[port] == PORT_FREQ_INDEX ?
				 440.0 / 44100 : 440.0;
		else if( LADSPA_IS_HINT_DEFAULT_MAXIMUM(hint_desc) )
			value = lad_hint->UpperBound;
		else if( LADSPA_IS_HINT_DEFAULT_MINIMUM(hint_desc) )
			value = lad_hint->LowerBound;
		else if( LADSPA_IS_HINT_DEFAULT_LOW(hint_desc) )
			value = LADSPA_IS_HINT_LOGARITHMIC(hint_desc) ?
				exp(log(lad_hint->LowerBound) * 0.25 +
					log(lad_hint->UpperBound) * 0.75) :
				lad_hint->LowerBound * 0.25 +
					lad_hint->UpperBound * 0.75;
		else if( LADSPA_IS_HINT_DEFAULT_MIDDLE(hint_desc) )
			value = LADSPA_IS_HINT_LOGARITHMIC(hint_desc) ?
				exp(log(lad_hint->LowerBound) * 0.5 +
					log(lad_hint->UpperBound) * 0.5) :
				lad_hint->LowerBound * 0.5 +
					lad_hint->UpperBound * 0.5;
		else if( LADSPA_IS_HINT_DEFAULT_HIGH(hint_desc) )
			value = LADSPA_IS_HINT_LOGARITHMIC(hint_desc) ?
				exp(log(lad_hint->LowerBound) * 0.75 +
					log(lad_hint->UpperBound) * 0.25) :
				lad_hint->LowerBound * 0.75 +
					lad_hint->UpperBound * 0.25;

		port_data[port] = value;
		++port;
	}
}
예제 #13
0
int VDevicePrefs::initialize(int creation)
{
	int *driver = 0;
	delete_objects();

	switch(mode)
	{
		case MODEPLAY:
			driver = &out_config->driver;
			break;

		case MODERECORD:
			driver = &in_config->driver;
			break;
	}
	this->driver = *driver;

	if(!menu)
	{
		dialog->add_subwindow(menu = new VDriverMenu(x,
			y + 10,
			this, 
			(mode == MODERECORD), 
			driver));
		menu->create_objects();
	}

	switch(this->driver)
	{
		case VIDEO4LINUX:
			create_v4l_objs();
			break;
		case VIDEO4LINUX2:
		case CAPTURE_JPEG_WEBCAM:
		case CAPTURE_YUYV_WEBCAM:
		case VIDEO4LINUX2JPEG:
		case CAPTURE_MPEG:
			create_v4l2_objs();
			break;
		case SCREENCAPTURE:
			create_screencap_objs();
			break;
		case CAPTURE_LML:
			create_lml_objs();
			break;
		case CAPTURE_BUZ:
		case PLAYBACK_BUZ:
			create_buz_objs();
			break;
		case PLAYBACK_X11:
		case PLAYBACK_X11_XV:
		case PLAYBACK_X11_GL:
			create_x11_objs();
			break;
		case PLAYBACK_DV1394:
		case PLAYBACK_FIREWIRE:
		case PLAYBACK_IEC61883:
		case CAPTURE_FIREWIRE:
		case CAPTURE_IEC61883:
			create_firewire_objs();
			break;
		case CAPTURE_DVB:
			create_dvb_objs();
			break;
	}



// Update driver dependancies in file format
	if(mode == MODERECORD && dialog && !creation)
	{
		RecordPrefs *record_prefs = (RecordPrefs*)dialog;
		record_prefs->recording_format->update_driver(this->driver);
	}

	return 0;
}
예제 #14
0
VDevicePrefs::~VDevicePrefs()
{
	delete_objects();
	if(menu) delete menu;
	pwindow->mwindow->channeldb_buz->save("channeldb_buz");
}
예제 #15
0
static void w7(PMEMobjpool *pop) {
	allocate_objects(pop, 1000, 2000);
	delete_objects(pop, 0.9);
	allocate_objects(pop, 1500, 2500);
}
ObjectDataObject::~ObjectDataObject(){
  delete_objects(m_objects);
}
예제 #17
0
static void w3(PMEMobjpool *pop) {
	allocate_objects(pop, 100, 100);
	delete_objects(pop, 0.9);
	allocate_objects(pop, 130, 130);
}
예제 #18
0
PluginAClientConfig::~PluginAClientConfig()
{
	delete_objects();
}
예제 #19
0
BeveledBoxShell::~BeveledBoxShell(void) {	
	delete_objects();				
}
예제 #20
0
Compound::~Compound()
{
	delete_objects();
}
예제 #21
0
static void w8(PMEMobjpool *pop) {
	allocate_objects(pop, 50, 150);
	delete_objects(pop, 0.9);
	allocate_objects(pop, 5000, 15000);
}
예제 #22
0
Level::~Level() {
  delete_objects(start_points_);
  delete_objects(spawn_points_);
  delete_objects(goals_);
  delete_objects(objects_);
}
예제 #23
0
static void w6(PMEMobjpool *pop) {
	allocate_objects(pop, 100, 200);
	delete_objects(pop, 0.5);
	allocate_objects(pop, 1000, 2000);
}