Esempio n. 1
0
// SCWSS_PointScan_FindSets():
EDError SCWSS_PointScan_FindSets( void *_op, const EDPointInfo *point ) {
  MeshEditOp *op = (MeshEditOp *)_op;

  float val;
  if( point->flags & EDDF_SELECT ) {
    for( int v=0; v < vmap_count; v++ ) {
      const char *set_name = object_funcs->vmapName( LWVMAP_PICK, v );
      void       *set_id   = op->pointVSet( op->state, NULL, LWVMAP_PICK, set_name );

      if( op->pointVGet( op->state, point->pnt, &val) != 0 ) {
        unsigned long i;
        for( i=0; i < selection_set_ids.NumElements(); i++ ) {
          if( selection_set_ids[i] == set_id )
            break;
        }

        if( i == selection_set_ids.NumElements() ) {
          selection_set_ids.Add( set_id );
          selection_set_names.Add( StringTools::strdup( set_name ) );
        }
      }
    }
  }

  return EDERR_NONE;
}
Esempio n. 2
0
// SCWSS_PointScan_Select():
EDError SCWSS_PointScan_Select( void *_op, const EDPointInfo *point ) {
  MeshEditOp *op = (MeshEditOp *)_op;

  float val;
  for( unsigned long i=0; i < selection_set_ids.NumElements(); i++ ) {
    if( !(point->flags & EDDF_SELECT) ) {
      op->pointVSet( op->state, selection_set_ids[i], NULL, NULL );

      if( op->pointVGet( op->state, point->pnt, &val) != 0 ) {
        return (*op->pntSelect)( op->state, point->pnt, 1 );
      }
    }
  }

  return EDERR_NONE;
}