Example #1
0
void BrickWallChart::paintContents (Graphics& g)
{
  AffineTransform t = calcTransform();

  {
    int y = yToScreen (0);

    g.setColour (m_cAxis);
    g.fillRect (getLocalBounds().getX() + 1, y,
                getLocalBounds().getWidth() - 2, 1);

    g.setColour (m_cText);
    drawText (g, Point<int> (6, y-2), "0");
  }

  {
    int y = yToScreen (1);

    g.setColour (m_cAxis);
    g.fillRect (getLocalBounds().getX() + 1, y,
                getLocalBounds().getWidth() - 2, 1);

    g.setColour (m_cText);
    drawText (g, Point<int> (6, y+2), "1", Justification::topLeft);
  }

  // path
  g.setColour (Colours::blue);
  g.strokePath (m_path, 1, t);
}
Example #2
0
void AreaNode::maybeRender(const glm::mat4& parentTransform)
{
    AVG_ASSERT(getState() == NS_CANRENDER);
    if (isVisible()) {
        calcTransform();
        m_Transform = parentTransform*m_LocalTransform;
        render();
    }
}
Foam::coordinateRotationOFext::coordinateRotationOFext
(
    const vector& axis,
    const vector& dir
)
:
    tensor(sphericalTensor::I)
{
    calcTransform(axis, dir, e3e1);
}
void Foam::coordinateRotationOFext::operator=(const dictionary& rhs)
{
    if (debug)
    {
        Pout<< "coordinateRotation::operator=(const dictionary&) : "
            << "assign from " << rhs << endl;
    }

    // allow as embedded sub-dictionary "coordinateRotation"
    const dictionary& dict =
    (
        rhs.found(typeName_())
      ? rhs.subDict(typeName_())
      : rhs
    );

    vector axis1, axis2;
    axisOrder order = e3e1;

    if (dict.readIfPresent("e1", axis1) && dict.readIfPresent("e2", axis2))
    {
        order = e1e2;
    }
    else if
    (
        dict.readIfPresent("e2", axis1)
     && dict.readIfPresent("e3", axis2)
    )
    {
        order = e2e3;
    }
    else if
    (
        dict.readIfPresent("e3", axis1)
     && dict.readIfPresent("e1", axis2)
    )
    {
        order = e3e1;
    }
    else if (dict.found("axis") || dict.found("direction"))
    {
        // let it bomb if only one of axis/direction is defined
        order = e3e1;
        axis1 = vector(dict.lookup("axis"));
        axis2 = vector(dict.lookup("direction"));
    }
    else
    {
        // unspecified axes revert to the global system
        tensor::operator=(sphericalTensor::I);
        return;
    }

    calcTransform(axis1, axis2, order);
}
Example #5
0
Foam::STARCDCoordinateRotation::STARCDCoordinateRotation
(
    const scalar rotZ,
    const scalar rotX,
    const scalar rotY,
    const bool inDegrees
)
:
    coordinateRotation()
{
    calcTransform(rotZ, rotX, rotY, inDegrees);
}
Example #6
0
void PhaseChart::paintContents (Graphics& g)
{
  AffineTransform t = calcTransform();

  g.setColour (Colours::black);
  drawPhaseLine (g, 0, false);

  g.setColour (m_cAxis);
  drawPhaseLine (g, 90);
  drawPhaseLine (g, -90);

  g.setColour (Colours::blue);
  g.strokePath (m_path, 1, t);
}
Example #7
0
void AreaNode::maybeRender()
{
    AVG_ASSERT(getState() == NS_CANRENDER);
    if (isVisible()) {
        if (getID() != "") {
            AVG_TRACE(Logger::BLTS, "Rendering " << getTypeStr() << 
                    " with ID " << getID());
        } else {
            AVG_TRACE(Logger::BLTS, "Rendering " << getTypeStr()); 
        }
        m_Transform = getParentTransform()*calcTransform();
        render();
    }
}
Example #8
0
Foam::STARCDCoordinateRotation::STARCDCoordinateRotation
(
    const vector& rotZrotXrotY,
    const bool inDegrees
)
:
    coordinateRotation()
{
    calcTransform
    (
        rotZrotXrotY.component(vector::X),
        rotZrotXrotY.component(vector::Y),
        rotZrotXrotY.component(vector::Z),
        inDegrees
    );
}
Example #9
0
Foam::STARCDCoordinateRotation::STARCDCoordinateRotation
(
    const dictionary& dict
)
:
    coordinateRotation()
{
    vector rotation(dict.lookup("rotation"));

    calcTransform
    (
        rotation.component(vector::X),
        rotation.component(vector::Y),
        rotation.component(vector::Z),
        dict.lookupOrDefault<Switch>("degrees", true)
    );
}
Example #10
0
void FunctionVessel::calculate( const unsigned& current, MultiValue& myvals, std::vector<double>& buffer, std::vector<unsigned>& der_list ) const {
  unsigned nderivatives=getFinalValue()->getNumberOfDerivatives();
  double weight=myvals.get(0); 
  plumed_dbg_assert( weight>=getTolerance() );  

  // This deals with the value
  double dval, f=calcTransform( myvals.get(mycomp), dval );

  if( norm ){
     if( usetol && weight<getTolerance() ) return;
     buffer[bufstart+1+nderivatives] += weight;
     if( diffweight ) myvals.chainRule( 0, 1, 1, 0, 1.0, bufstart, buffer );
  }

  double contr=weight*f;
  if( usetol && contr<getTolerance() ) return;
  buffer[bufstart] += contr;

  if( diffweight ) myvals.chainRule( 0, 0, 1, 0, f, bufstart, buffer ); 
  if( getAction()->derivativesAreRequired() && fabs(dval)>0.0 ) myvals.chainRule( mycomp, 0, 1, 0, weight*dval, bufstart, buffer );

  return;
}
Example #11
0
int BrickWallChart::yToScreen (float y)
{
  AffineTransform t = calcTransform();
  Point<float> p (0, y);
  return int(p.transformedBy (t).getY());
}
Example #12
0
void ScreenWidget::setScreenBuffer(unsigned int* buf, const QSize& size, qreal scale) {
	this->mScreenBuf = buf;
	this->mScreenSize = size;
	this->mScale = scale;
	calcTransform();
}
Example #13
0
void ScreenWidget::resizeEvent(QResizeEvent* event) {
	calcTransform();
}