예제 #1
0
void CRoom::setRegion(QByteArray name)
{
    if (name == "")
        setRegion(parent->getRegionByName("default"));
    else 
        setRegion(parent->getRegionByName(name));
}
예제 #2
0
//! mouse movement in map canvas
void QgsGrassRegionEdit::canvasMoveEvent( QMouseEvent * event )
{
  if ( !mDraw ) return;

  mEndPoint = toMapCoordinates( event->pos() );
  setRegion( mStartPoint, mEndPoint );
}
예제 #3
0
  void StructuredVolume::getVolumeFromMemory() 
  {
    //! Create the equivalent ISPC volume container and allocate memory for voxel data.
    createEquivalentISPC();

    //! Get a pointer to the source voxel data.
    const Data *voxelData = getParamData("voxelData", NULL);  
    exitOnCondition(voxelData == NULL, "no voxel data specified");  

    const uint8 *data = (const uint8 *) voxelData->data;

    //! The dimensions of the source voxel data and target volume must match.
    exitOnCondition(size_t(volumeDimensions.x) * volumeDimensions.y * volumeDimensions.z != voxelData->numItems, "unexpected source voxel data dimensions");

    //! The source and target voxel types must match.
    exitOnCondition(getVoxelType() != voxelData->type, "unexpected source voxel type");

    //! Size of a volume slice in bytes.
    size_t sliceSizeInBytes = volumeDimensions.x * volumeDimensions.y * getVoxelSizeInBytes();

    //! Copy voxel data into the volume in slices to avoid overflow in ISPC offset calculations.
    for (size_t z=0 ; z < volumeDimensions.z ; z++) 
      setRegion(&data[z * sliceSizeInBytes], vec3i(0, 0, z), 
                vec3i(volumeDimensions.x, volumeDimensions.y, 1));

  }
예제 #4
0
파일: regionmap.cpp 프로젝트: ace13/openmw
void CSVWorld::RegionMap::setRegion()
{
    if (mEditLock)
        return;

    setRegion (mRegionId);
}
예제 #5
0
파일: regionmap.cpp 프로젝트: ace13/openmw
void CSVWorld::RegionMap::unsetRegion()
{
    if (mEditLock)
        return;

    setRegion ("");
}
예제 #6
0
void RegionEditDialog::init(QRegion aValue, const PropertyAttributes *aAttributes)
{
    ui->setupUi(this);

    minCount=0;
    maxCount=INT_MAX;

    mAttributes=aAttributes;

    if (aAttributes)
    {
        minCount=aAttributes->intValue("minCount", minCount);
        maxCount=aAttributes->intValue("maxCount", maxCount);

        if (minCount<0)
        {
            minCount=0;
        }

        if (maxCount<minCount)
        {
            maxCount=minCount;
        }
    }

    setRegion(aValue);
}
예제 #7
0
void Image::resize(const Box& newExterior)
	{
	/* Resize the parent class widget: */
	Widget::resize(newExterior);
	
	/* Adjust the displayed image region: */
	setRegion(region);
	}
예제 #8
0
파일: graphics.hpp 프로젝트: emersonmx/gmx
 void setRegion(int x, int y, int width, int height) {
     float invTexWidth = 1.f / texture.getWidth();
     float invTexHeight = 1.f / texture.getHeight();
     setRegion(x * invTexWidth, y * invTexHeight,
               (x + width) * invTexWidth, (y + height) * invTexHeight);
     regionWidth = abs(width);
     regionHeight = abs(height);
 }
예제 #9
0
void ClsQStateArrayViewSparse::setRegion(double fValue, ClsRegion _clsRegion) {
    int iXStart = _clsRegion.getXStart();
    int iYStart = _clsRegion.getYStart();
    int iWidth  = _clsRegion.getWidth();
    int iHeight = _clsRegion.getHeight();

    setRegion(fValue, iXStart, iYStart, iWidth, iHeight);
}
예제 #10
0
//! mouse button released
void QgsGrassRegionEdit::canvasReleaseEvent( QMouseEvent * event )
{
  if ( !mDraw ) return;

  mEndPoint = toMapCoordinates( event->pos() );
  setRegion( mStartPoint, mEndPoint );
  mDraw = false;
  emit captureEnded();
}
예제 #11
0
void TextCursor::update(const QFontMetrics& qfm)
{
	int xstart = qfm.width(owner()->text().left(selectionFirstIndex()));
	int xend = qfm.width(owner()->text().left(selectionLastIndex()));
	setX(xstart, xend);

	QSize cursorSize = QSize(2, owner()->height() - 2);
	setVisualizationSize(cursorSize);
	setRegion(QRect(position(), cursorSize));
}
예제 #12
0
	VCFReader::VCFReader(const std::string& filename, std::vector< graphite::Sample::SharedPtr >& bamSamplePtrs, Region::SharedPtr regionPtr, VCFWriter::SharedPtr vcfWriter) :
		m_filename(filename),
		m_region_ptr(nullptr),
		m_file_stream_ptr(nullptr),
		m_preloaded_variant(nullptr),
		m_vcf_writer(vcfWriter)
	{
		openFile(); // open the vcf
		processHeader(bamSamplePtrs); // read the header
		setRegion(regionPtr);
	}
예제 #13
0
//! mouse pressed in map canvas
void QgsGrassRegionEdit::canvasPressEvent( QgsMapMouseEvent * event )
{
  mDraw = true;
  mRubberBand->reset( QgsWkbTypes::PolygonGeometry );
  mSrcRubberBand->reset( QgsWkbTypes::PolygonGeometry );
  emit captureStarted();

  mStartPoint = toMapCoordinates( event->pos() );
  mEndPoint = mStartPoint;
  setRegion( mStartPoint, mEndPoint );
}
예제 #14
0
bool SamplerWriteNode::onNodeAttributeChanged(const char *name, const Message &value)
{
    const static std::string writing(ATTR_WRITING);
    const static std::string region(ATTR_REGION);

    if (writing == name)
        record(value.getBoolean(0));
    if (region == name)
        setRegion(value.getString(0));
    return true;
}
예제 #15
0
파일: game.cpp 프로젝트: wheein/MiHaJong
TableProtoScene::TableProtoScene(ScreenManipulator* const manipulator) : Scene(manipulator) {
	LoadTexture(&tSideBar, MAKEINTRESOURCE(IDB_PNG_SDBAR));
	InitScorePanel();
	const Region nullRegion = {0, 0, -1, -1};
	for (int i = 0; i < NumOfCheckBoxes; ++i) {
		checkBoxes[i] = new CheckBox(manipulator->getDevice(), labels[i], Geometry::BaseSize + 20, 940 + i * 40);
		setRegion(i + CheckboxRegionOffset,
			Geometry::BaseSize + 20,                                        940 + i * 40,
			Geometry::BaseSize + 20 + 36 + checkBoxes[i]->captionWidthPx(), 940 + i * 40 + 36);
	}
}
예제 #16
0
//! mouse pressed in map canvas
void QgsGrassRegionEdit::canvasPressEvent( QMouseEvent * event )
{
  QgsDebugMsg( "entered." );
  mDraw = true;
  mRubberBand->reset( true );
  mSrcRubberBand->reset( true );
  emit captureStarted();

  mStartPoint = toMapCoordinates( event->pos() );
  mEndPoint = mStartPoint;
  setRegion( mStartPoint, mEndPoint );
}
예제 #17
0
NativeResource::NativeResource(unsigned int x, unsigned int y, unsigned int w, unsigned int h, VC_IMAGE_TYPE_T type, void * _imageData, int _imagePitch)
	: resourceHandle(0), rgbType(type), nativeImageHandle(0), imageData(_imageData ), imagePitch(_imagePitch)
{
	int ret;

	setRegion(x,y,w,h);

    resourceHandle = vc_dispmanx_resource_create( rgbType, region.width, region.height, &nativeImageHandle );
    ret = vc_dispmanx_resource_write_data( resourceHandle, rgbType, imagePitch, imageData, &region );
    if ( ret != 0 )
    	throw runtime_error("runtime error : NativeResource::NativeResource ** resourceWriteData failed.");

}
예제 #18
0
void BioStruct3DSubsetEditor::fillRegionEdit() {
    if (chainCombo->currentText() != ALL_CHAINS) {
        BioStruct3DObject *bso = static_cast<BioStruct3DObject*>( objectCombo->itemData(objectCombo->currentIndex()).value<void*>() );
        int chainId = chainCombo->itemData(chainCombo->currentIndex()).value<int>();
        int length = bso->getBioStruct3D().moleculeMap.value(chainId)->residueMap.size();

        setRegion(U2Region(0, length));
        regionEdit->setEnabled(true);
    }
    else {
        regionEdit->setText("");
        regionEdit->setDisabled(true);
    }
}
예제 #19
0
파일: regionmap.cpp 프로젝트: ace13/openmw
CSVWorld::RegionMap::RegionMap (const CSMWorld::UniversalId& universalId,
                                CSMDoc::Document& document, QWidget *parent)
    :  DragRecordTable(document, parent)
{
    verticalHeader()->hide();
    horizontalHeader()->hide();

    setSelectionMode (QAbstractItemView::ExtendedSelection);

    setModel (document.getData().getTableModel (universalId));

    resizeColumnsToContents();
    resizeRowsToContents();

    mSelectAllAction = new QAction (tr ("Select All"), this);
    connect (mSelectAllAction, SIGNAL (triggered()), this, SLOT (selectAll()));
    addAction (mSelectAllAction);

    mClearSelectionAction = new QAction (tr ("Clear Selection"), this);
    connect (mClearSelectionAction, SIGNAL (triggered()), this, SLOT (clearSelection()));
    addAction (mClearSelectionAction);

    mSelectRegionsAction = new QAction (tr ("Select Regions"), this);
    connect (mSelectRegionsAction, SIGNAL (triggered()), this, SLOT (selectRegions()));
    addAction (mSelectRegionsAction);

    mCreateCellsAction = new QAction (tr ("Create Cells Action"), this);
    connect (mCreateCellsAction, SIGNAL (triggered()), this, SLOT (createCells()));
    addAction (mCreateCellsAction);

    mSetRegionAction = new QAction (tr ("Set Region"), this);
    connect (mSetRegionAction, SIGNAL (triggered()), this, SLOT (setRegion()));
    addAction (mSetRegionAction);

    mUnsetRegionAction = new QAction (tr ("Unset Region"), this);
    connect (mUnsetRegionAction, SIGNAL (triggered()), this, SLOT (unsetRegion()));
    addAction (mUnsetRegionAction);

    mViewAction = new QAction (tr ("View Cells"), this);
    connect (mViewAction, SIGNAL (triggered()), this, SLOT (view()));
    addAction (mViewAction);

    mViewInTableAction = new QAction (tr ("View Cells in Table"), this);
    connect (mViewInTableAction, SIGNAL (triggered()), this, SLOT (viewInTable()));
    addAction (mViewInTableAction);

    setAcceptDrops(true);
}
예제 #20
0
CRoom::CRoom(CRoomManager *parent) :
    parent(parent)
{
    square = NULL;
    setRegion("default");

    // populate room.exits with "none" exits

    // the infamoust cycle
    // special version tho! this one creates the "ED_UNKNOWN" exit, for compatibility sake
    for (int i = 0; i <= 6; i++) {
        mapdata::Exit::ExitDirection dir = static_cast<mapdata::Exit::ExitDirection>(i);
        mapdata::Exit* exit = room.add_exits();
        exit->set_dir(dir);
    }
}
예제 #21
0
void ClsBaseQStateArrayView::mouseReleaseEvent ( QMouseEvent * e ) {
#ifdef DEBUG_CLSBASEQSTATEARRAYVIEW
    cout << "ClsBaseQStateArrayView::mouseReleaseEvent ( QMouseEvent * e )" << endl;
#endif
//--------------------
    int iXIndexStart = pos2index2(iXPosStart);
    iXIndexStart = (iXIndexStart <= 0 ? 1 : iXIndexStart);
    iXIndexStart = (iXIndexStart > iNrCellsX ? iNrCellsX : iXIndexStart);

    int iXIndex = pos2index2( e->pos().x());
    iXIndex = (iXIndex <= 0 ? 1 : iXIndex);
    iXIndex = (iXIndex > iNrCellsX ? iNrCellsX : iXIndex);

    int iX = (iXIndexStart < iXIndex ? iXIndexStart : iXIndex);
    int iW = abs(iXIndexStart - iXIndex) +1;
//--------------------

//--------------------
    int iYIndexStart = pos2index2(iYPosStart);
    iYIndexStart = (iYIndexStart <= 0 ? 1 : iYIndexStart);
    iYIndexStart = (iYIndexStart > iNrCellsY ? iNrCellsY : iYIndexStart);

    int iYIndex = pos2index2( e->pos().y());
    iYIndex = (iYIndex <= 0 ? 1 : iYIndex);
    iYIndex = (iYIndex > iNrCellsY ? iNrCellsY : iYIndex);

    int iY = (iYIndexStart < iYIndex ? iYIndexStart : iYIndex);
    int iH = abs(iYIndexStart - iYIndex) +1;
//--------------------

    if (iSelectionMode == ClsBaseQStateArrayView::REGION){
	clear();
	setRegion(fFixedValue, iX, iY, iW, iH);

    }

    iXPosStart = iYPosStart = 0; //**
}
/*!
    \fn void QDirectPainter::setGeometry(const QRect &rectangle)
    \since 4.2

    Request to reserve the given \a rectangle of the framebuffer.

    Note that the actually allocated region might differ from the
    requested one, e.g., if the given region overlaps with the
    region of another QDirectPainter object.

    \sa geometry(), allocatedRegion(), setRegion()
*/
void QDirectPainter::setGeometry(const QRect &rect)
{
    setRegion(rect);
}
예제 #23
0
Theme::Skin::Skin(float tw, float th, const Rectangle& region, const Theme::Border& border, const Vector4& color)
    : _border(border), _color(color), _region(region)
{
    setRegion(region, tw, th);
}
예제 #24
0
파일: place.cpp 프로젝트: junjiek/Placer
myPlacement::myPlacement(Block *topBlock)
        : plcTopBlock(topBlock)
{
	setRegion();
}
예제 #25
0
void JabberContact::deserializeLine(const QString& key, const QString& value)
{

    QString val = value;
    if(val.startsWith('\"') && val.endsWith('\"'))
        val = val.mid(1, val.length() - 2);
    if(key == "ID") {
        setId(val);
    }
    else if(key == "Node") {
        setNode(val);
    }
    else if(key == "Resource") {
        setResource(val);
    }
    else if(key == "Name") {
        setName(val);
    }
    else if(key == "FirstName") {
        setFirstName(val);
    }
    else if(key == "Nick") {
        setNick(val);
    }
    else if(key == "Desc") {
        setDesc(val);
    }
    else if(key == "BirthDay") {
        setBirthday(val);
    }
    else if(key == "Url") {
        setUrl(val);
    }
    else if(key == "OrgName") {
        setOrgName(val);
    }
    else if(key == "OrgUnit") {
        setOrgUnit(val);
    }
    else if(key == "Title") {
        setTitle(val);
    }
    else if(key == "Role") {
        setRole(val);
    }
    else if(key == "Street") {
        setStreet(val);
    }
    else if(key == "ExtAddr") {
        setExtAddr(val);
    }
    else if(key == "City") {
        setCity(val);
    }
    else if(key == "Region") {
        setRegion(val);
    }
    else if(key == "PCode") {
        setPCode(val);
    }
    else if(key == "Country") {
        setCountry(val);
    }
    else if(key == "EMail") {
        setEmail(val);
    }
    else if(key == "Phone") {
        setPhone(val);
    }
    else if(key == "StatusTime") {
        setStatusTime(val.toUInt());
    }
    else if(key == "OnlineTime") {
        setOnlineTime(val.toUInt());
    }
    else if(key == "Subscribe") {
        setSubscribe(val.toUInt());
    }
    else if(key == "Group") {
        setGroup(val);
    }
    else if(key == "PhotoWidth") {
        setPhotoWidth(val.toUInt());
    }
    else if(key == "PhotoHeight") {
        setPhotoHeight(val.toUInt());
    }
    else if(key == "LogoWidth") {
        setLogoWidth(val.toUInt());
    }
    else if(key == "LogoHeight") {
        setLogoHeight(val.toUInt());
    }
    else if(key == "AutoReply") {
        setAutoReply(val);
    }
}
예제 #26
0
파일: graphics.hpp 프로젝트: emersonmx/gmx
 TextureRegion(Texture<T>& texture, float u, float v, float u2, float v2)
         : texture(texture) {
     setRegion(u, v, u2, v2);
 }
예제 #27
0
파일: graphics.hpp 프로젝트: emersonmx/gmx
 TextureRegion(Texture<T>& texture, int x, int y, int width, int height)
         : texture(texture) {
     setRegion(x, y, width, height);
 }
예제 #28
0
파일: graphics.hpp 프로젝트: emersonmx/gmx
 TextureRegion(Texture<T>& texture, int width, int height) : texture(texture) {
     setRegion(0, 0, width, height);
 }
예제 #29
0
파일: graphics.hpp 프로젝트: emersonmx/gmx
 TextureRegion(Texture<T>& texture) : texture(texture) {
     setRegion(0, 0, texture.getWidth(), texture.getHeight());
 }
예제 #30
0
파일: scrtest.c 프로젝트: junwuwei/brltty
int
main (int argc, char *argv[]) {
  ProgramExitStatus exitStatus;
  void *driverObject;

  {
    static const OptionsDescriptor descriptor = {
      OPTION_TABLE(programOptions),
      .applicationName = "scrtest",
      .argumentsSummary = "[parameter=value ...]"
    };
    PROCESS_OPTIONS(descriptor, argc, argv);
  }

  if ((screen = loadScreenDriver(opt_screenDriver, &driverObject, opt_driversDirectory))) {
    const char *const *parameterNames = getScreenParameters(screen);
    char **parameterSettings;

    if (!parameterNames) {
      static const char *const noNames[] = {NULL};
      parameterNames = noNames;
    }

    {
      const char *const *name = parameterNames;
      unsigned int count;
      char **setting;
      while (*name) ++name;
      count = name - parameterNames;
      if (!(parameterSettings = malloc((count + 1) * sizeof(*parameterSettings)))) {
        logMallocError();
        return PROG_EXIT_FATAL;
      }
      setting = parameterSettings;
      while (count--) *setting++ = "";
      *setting = NULL;
    }

    while (argc) {
      char *assignment = *argv++;
      int ok = 0;
      char *delimiter = strchr(assignment, '=');
      if (!delimiter) {
        logMessage(LOG_ERR, "missing screen parameter value: %s", assignment);
      } else if (delimiter == assignment) {
        logMessage(LOG_ERR, "missing screen parameter name: %s", assignment);
      } else {
        size_t nameLength = delimiter - assignment;
        const char *const *name = parameterNames;
        while (*name) {
          if (strncasecmp(assignment, *name, nameLength) == 0) {
            parameterSettings[name - parameterNames] = delimiter + 1;
            ok = 1;
            break;
          }
          ++name;
        }
        if (!ok) logMessage(LOG_ERR, "invalid screen parameter: %s", assignment);
      }
      if (!ok) return PROG_EXIT_SYNTAX;
      --argc;
    }

    if (constructScreenDriver(parameterSettings)) {
      ScreenDescription description;
      int left, top, width, height;

      describeScreen(&description);
      printf("Screen: %dx%d\n", description.cols, description.rows);
      printf("Cursor: [%d,%d]\n", description.posx, description.posy);

      if (setRegion(&left, opt_boxLeft, "starting column",
                &width, opt_boxWidth, description.cols, "region width")) {
        if (setRegion(&top, opt_boxTop, "starting row",
                  &height, opt_boxHeight, description.rows, "region height")) {
          printf("Region: %dx%d@[%d,%d]\n", width, height, left, top);

          {
            ScreenCharacter buffer[width * height];

            if (readScreen(left, top, width, height, buffer)) {
              int line;
              for (line=0; line<height; line++) {
                int column;
                for (column=0; column<width; column++) {
                  wchar_t character = buffer[line * width + column].text;
                  if (!iswLatin1(character)) {
                    putchar('?');
                  } else if (!isprint(character)) {
                    putchar('*');
                  } else {
                    putchar(character);
                  }
                }
                putchar('\n');
              }
              exitStatus = PROG_EXIT_SUCCESS;
            } else {
              logMessage(LOG_ERR, "Can't read screen.");
              exitStatus = PROG_EXIT_FATAL;
            }
          }
        } else {
          exitStatus = PROG_EXIT_SYNTAX;
        }
      } else {
        exitStatus = PROG_EXIT_SYNTAX;
      }
    } else {
      logMessage(LOG_ERR, "can't open screen.");
      exitStatus = PROG_EXIT_FATAL;
    }

    destructScreenDriver();
  } else {
    logMessage(LOG_ERR, "can't load screen driver.");
    exitStatus = PROG_EXIT_FATAL;
  }
  return exitStatus;
}